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