10 const unsigned AttrEscapedIndex = 0;
11 const unsigned AttrUnknownIndex = 1;
12 const unsigned AttrGlobalIndex = 2;
13 const unsigned AttrCallerIndex = 3;
14 const unsigned AttrFirstArgIndex = 4;
16 const unsigned AttrMaxNumArgs = AttrLastArgIndex - AttrFirstArgIndex;
21 const AliasAttr AttrNone = 0;
22 const AliasAttr AttrEscaped = 1 << AttrEscapedIndex;
23 const AliasAttr AttrUnknown = 1 << AttrUnknownIndex;
24 const AliasAttr AttrGlobal = 1 << AttrGlobalIndex;
25 const AliasAttr AttrCaller = 1 << AttrCallerIndex;
26 const AliasAttr ExternalAttrMask = AttrEscaped | AttrUnknown | AttrGlobal;
37 return Attr.test(AttrUnknownIndex) || Attr.test(AttrCallerIndex);
44 if (ArgNum >= AttrMaxNumArgs)
48 return AliasAttr(1ULL << (ArgNum + AttrFirstArgIndex));
52 if (isa<GlobalValue>(Val))
55 if (
auto *
Arg = dyn_cast<Argument>(&Val))
59 if (!
Arg->hasNoAliasAttr() &&
Arg->getType()->isPointerTy())
65 return Attr.reset(AttrEscapedIndex)
66 .reset(AttrUnknownIndex)
67 .reset(AttrCallerIndex)
79 if (V->getType()->isPointerTy())
static const unsigned NumAliasAttrs
The number of attributes that AliasAttr should contain.
This class represents lattice values for constants.
We use ExternalRelation to describe an externally visible aliasing relations between parameters/retur...
This is the result of instantiating InterfaceValue at a particular call.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
We use ExternalAttribute to describe an externally visible AliasAttrs for parameters/return value...
We use InterfaceValue to describe parameters/return value, as well as potential memory locations that...
Value * getArgOperand(unsigned i) const
Optional< InstantiatedAttr > instantiateExternalAttribute(ExternalAttribute EAttr, CallBase &Call)
Optional< InstantiatedValue > instantiateInterfaceValue(InterfaceValue IValue, CallBase &Call)
Optional< InstantiatedRelation > instantiateExternalRelation(ExternalRelation ERelation, CallBase &Call)
static AliasAttr argNumberToAttr(unsigned ArgNum)
AliasAttrs getAttrEscaped()
AttrEscaped represent whether the said pointer comes from a known source but escapes to the unknown w...
bool hasUnknownAttr(AliasAttrs Attr)
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
bool isGlobalOrArgAttr(AliasAttrs Attr)
AliasAttrs getAttrUnknown()
AttrUnknown represent whether the said pointer comes from a source not known to alias analyses (such ...
BlockVerifier::State From
AliasAttrs getExternallyVisibleAttrs(AliasAttrs Attr)
Given an AliasAttrs, return a new AliasAttrs that only contains attributes meaningful to the caller...
This file defines various utility types and functions useful to summary-based alias analysis...
AliasAttrs getGlobalOrArgAttrFromValue(const Value &Val)
AttrGlobal represent whether the said pointer is a global value.
bool hasUnknownOrCallerAttr(AliasAttrs Attr)
std::bitset< NumAliasAttrs > AliasAttrs
These are attributes that an alias analysis can use to mark certain special properties of a given poi...
bool hasCallerAttr(AliasAttrs Attr)
AliasAttrs getAttrCaller()
AttrCaller represent whether the said pointer comes from a source not known to the current function b...
This is the result of instantiating ExternalRelation at a particular callsite.
bool hasEscapedAttr(AliasAttrs Attr)
LLVM Value Representation.
AliasAttrs getAttrNone()
Attr represent whether the said pointer comes from an unknown source (such as opaque memory or an int...
This is the result of instantiating ExternalAttribute at a particular callsite.