22#define DEBUG_TYPE "NVPTX-aa"
30 "NVPTX Address space based Alias Analysis",
false,
true)
33 "NVPTX Address space based Alias Analysis Wrapper",
false,
true)
62 auto GetAS = [](
const Value *
V) ->
unsigned {
64 return PTy->getAddressSpace();
117 return AS == AddressSpace::ADDRESS_SPACE_CONST ||
118 AS == AddressSpace::ADDRESS_SPACE_ENTRY_PARAM;
137 if (IA->hasSideEffects())
142 if (Constraint.isIndirect)
148 [](
const auto &Code) { return Code ==
"{memory}"; }))
static AliasResult::Kind getAliasResult(unsigned AS1, unsigned AS2)
static bool isConstOrParam(unsigned AS)
static unsigned getAddressSpace(const Value *V, unsigned MaxLookup)
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.
A container for analyses that lazily runs them and caches their results.
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.
A Module instance is used to store all the information related to an LLVM module.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI=nullptr)
MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI)
ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals)
Legacy wrapper pass to provide the NVPTXAAResult object.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
NVPTXAAResult run(Function &F, AnalysisManager< Function > &AM)
LLVM Value Representation.
@ ADDRESS_SPACE_SHARED_CLUSTER
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
ImmutablePass * createNVPTXExternalAAWrapperPass()
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.
LLVM_ABI const Value * getUnderlyingObject(const Value *V, unsigned MaxLookup=MaxLookupSearchDepth, bool MustPreserveProvenance=false)
This method strips off any GEP address adjustments, pointer casts or llvm.threadlocal....
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.
const NVPTXOptions & getNVPTXOptions(const LLVMContext &C)
ImmutablePass * createNVPTXAAWrapperPass()
A special type used by analysis passes to provide an address that identifies that particular analysis...