LLVM: lib/Target/NVPTX/NVPTXAliasAnalysis.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
19
20using namespace llvm;
21
22#define DEBUG_TYPE "NVPTX-aa"
23
25 "nvptx-traverse-address-aliasing-limit", cl::Hidden,
26 cl::desc("Depth limit for finding address space through traversal"),
28
30
33
35 "NVPTX Address space based Alias Analysis", false, true)
36
38 "NVPTX Address space based Alias Analysis Wrapper", false, true)
39
43
47
49
53
55
56
57
58 auto GetAS = [](const Value *V) -> unsigned {
60 return PTy->getAddressSpace();
62 };
65 if (NewV == V)
66 break;
67 V = NewV;
68 }
69 return GetAS(V);
70}
71
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
94
96}
97
106
107
108
109
111 return AS == AddressSpace::ADDRESS_SPACE_CONST ||
112 AS == AddressSpace::ADDRESS_SPACE_PARAM;
113}
114
117 bool IgnoreLocals) {
120
122}
123
126
127
129
130 if (IA->hasSideEffects())
132
134
135 if (Constraint.isIndirect)
137
138
140 any_of(Constraint.Codes,
141 [](const auto &Code) { return Code == "{memory}"; }))
143 }
145 }
146
148}
static cl::opt< unsigned > TraverseAddressSpacesLimit("nvptx-traverse-address-aliasing-limit", cl::Hidden, cl::desc("Depth limit for finding address space through traversal"), cl::init(6))
static AliasResult::Kind getAliasResult(unsigned AS1, unsigned AS2)
Definition NVPTXAliasAnalysis.cpp:72
static bool isConstOrParam(unsigned AS)
Definition NVPTXAliasAnalysis.cpp:110
static unsigned getAddressSpace(const Value *V, unsigned MaxLookup)
Definition NVPTXAliasAnalysis.cpp:54
This is the NVPTX address space based alias analysis pass.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This class stores info we want to provide to or retain within an alias query.
The possible results of an alias query.
@ MayAlias
The two locations may or may not alias.
@ NoAlias
The two locations do not alias at all.
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
ImmutablePass class - This class is used to provide information that does not need to be run.
static MemoryEffectsBase none()
static MemoryEffectsBase unknown()
Representation for a specific memory location.
const Value * Ptr
The address of the start of the location.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI=nullptr)
Definition NVPTXAliasAnalysis.cpp:98
MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI)
Definition NVPTXAliasAnalysis.cpp:124
ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals)
Definition NVPTXAliasAnalysis.cpp:115
Legacy wrapper pass to provide the NVPTXAAResult object.
NVPTXAAWrapperPass()
Definition NVPTXAliasAnalysis.cpp:48
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition NVPTXAliasAnalysis.cpp:50
LLVM Value Representation.
@ ADDRESS_SPACE_SHARED_CLUSTER
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
ImmutablePass * createNVPTXExternalAAWrapperPass()
Definition NVPTXAliasAnalysis.cpp:44
MemoryEffectsBase< IRMemLocation > MemoryEffects
Summary of how a function affects memory in the program.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
@ ModRef
The access may reference and may modify the value stored in memory.
@ NoModRef
The access neither references nor modifies the value stored in memory.
ImmutablePass * createNVPTXAAWrapperPass()
Definition NVPTXAliasAnalysis.cpp:40
LLVM_ABI const Value * getUnderlyingObject(const Value *V, unsigned MaxLookup=MaxLookupSearchDepth)
This method strips off any GEP address adjustments, pointer casts or llvm.threadlocal....
A special type used by analysis passes to provide an address that identifies that particular analysis...