Go to the documentation of this file.
19 #define DEBUG_TYPE "amdgpu-aa"
28 "AMDGPU Address space based Alias Analysis",
false,
true)
55 #define ASMay AliasResult::MayAlias
56 #define ASNo AliasResult::NoAlias
72 return ASAliasRules[AS1][AS2];
100 if (
const LoadInst *LI = dyn_cast<LoadInst>(ObjA)) {
107 }
else if (
const Argument *
Arg = dyn_cast<Argument>(ObjA)) {
109 switch (
F->getCallingConv()) {
135 AS =
Base->getType()->getPointerAddressSpace();
141 if (GV->isConstant())
147 switch (
F->getCallingConv()) {
162 unsigned ArgNo =
Arg->getArgNo();
170 if (
F->hasParamAttribute(ArgNo, Attribute::NoAlias) &&
171 (
F->hasParamAttribute(ArgNo, Attribute::ReadNone) ||
172 F->hasParamAttribute(ArgNo, Attribute::ReadOnly))) {
This class represents an incoming formal argument to a Function.
@ MayAlias
The two locations may or may not alias.
This is an optimization pass for GlobalISel generic memory operations.
bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool OrLocal)
@ AMDGPU_HS
Calling convention used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
@ AMDGPU_VS
Calling convention used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (ve...
ImmutablePass class - This class is used to provide information that does not need to be run.
const Value * Ptr
The address of the start of the location.
amdgpu aa AMDGPU Address space based Alias Analysis Wrapper
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Legacy wrapper pass to provide the AMDGPUAAResult object.
The possible results of an alias query.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
ImmutablePass * createAMDGPUExternalAAWrapperPass()
@ CONSTANT_ADDRESS_32BIT
Address space for 32-bit constant memory.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
This class stores info we want to provide to or retain within an alias query.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Represent the analysis usage information of a pass.
@ AMDGPU_ES
Calling convention used for AMDPAL shader stage before geometry shader if geometry is in use.
@ AMDGPU_GS
Calling convention used for Mesa/AMDPAL geometry shaders.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
@ LOCAL_ADDRESS
Address space for local memory.
const Value * getUnderlyingObject(const Value *V, unsigned MaxLookup=6)
This method strips off any GEP address adjustments and pointer casts from the specified value,...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
ImmutablePass * createAMDGPUAAWrapperPass()
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
A special type used by analysis passes to provide an address that identifies that particular analysis...
@ CONSTANT_ADDRESS
Address space for constant memory (VTX2).
static AliasResult getAliasResult(unsigned AS1, unsigned AS2)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
void initializeAMDGPUAAWrapperPassPass(PassRegistry &)
INITIALIZE_PASS(AMDGPUAAWrapperPass, "amdgpu-aa", "AMDGPU Address space based Alias Analysis", false, true) INITIALIZE_PASS(AMDGPUExternalAAWrapper
@ PRIVATE_ADDRESS
Address space for private memory.
@ AMDGPU_PS
Calling convention used for Mesa/AMDPAL pixel shaders.
Type * getType() const
All values are typed, get the type of this value.
@ NoAlias
The two locations do not alias at all.
An instruction for reading from memory.
@ AMDGPU_KERNEL
Calling convention for AMDGPU code object kernels.
void setPreservesAll()
Set by analyses that do not transform their input at all.
bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool OrLocal)
@ FLAT_ADDRESS
Address space for flat memory.
@ AMDGPU_LS
Calling convention used for AMDPAL vertex shader if tessellation is in use.
@ SPIR_KERNEL
SPIR_KERNEL - Calling convention for SPIR kernel functions.
@ AMDGPU_CS
Calling convention used for Mesa/AMDPAL compute shaders.
LLVM Value Representation.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
Representation for a specific memory location.