Go to the documentation of this file.
65 if (!mayAliasInScopes(AScopes, BNoAlias))
68 if (!mayAliasInScopes(BScopes, ANoAlias))
82 Call->getMetadata(LLVMContext::MD_noalias)))
85 if (!mayAliasInScopes(Call->getMetadata(LLVMContext::MD_alias_scope),
98 if (!mayAliasInScopes(Call1->
getMetadata(LLVMContext::MD_alias_scope),
102 if (!mayAliasInScopes(Call2->
getMetadata(LLVMContext::MD_alias_scope),
112 if (
const MDNode *MD = dyn_cast<MDNode>(MDOp))
117 bool ScopedNoAliasAAResult::mayAliasInScopes(
const MDNode *Scopes,
118 const MDNode *NoAlias)
const {
119 if (!Scopes || !NoAlias)
125 if (
const MDNode *NAMD = dyn_cast<MDNode>(MDOp))
134 if (ScopeNodes.
empty())
158 "Scoped NoAlias Alias Analysis",
false,
true)
@ NoModRef
The access neither references nor modifies the value stored in memory.
This is an optimization pass for GlobalISel generic memory operations.
void initializeScopedNoAliasAAWrapperPassPass(PassRegistry &)
bool set_is_subset(const S1Ty &S1, const S2Ty &S2)
set_is_subset(A, B) - Return true iff A in B
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
ImmutablePass class - This class is used to provide information that does not need to be run.
static cl::opt< bool > EnableScopedNoAlias("enable-scoped-noalias", cl::init(true), cl::Hidden)
The possible results of an alias query.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
MDNode * Scope
The tag for alias scope specification (used with noalias).
This class stores info we want to provide to or retain within an alias query.
AAMDNodes AATags
The metadata nodes which describes the aliasing of the location (each member is null if that kind of ...
static void collectMDInDomain(const MDNode *List, const MDNode *Domain, SmallPtrSetImpl< const MDNode * > &Nodes)
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
Represent the analysis usage information of a pass.
ScopedNoAliasAAWrapperPass()
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
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...
initializer< Ty > init(const Ty &Val)
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
INITIALIZE_PASS(ScopedNoAliasAAWrapperPass, "scoped-noalias-aa", "Scoped NoAlias Alias Analysis", false, true) ImmutablePass *llvm
A Module instance is used to store all the information related to an LLVM module.
@ NoAlias
The two locations do not alias at all.
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
A simple AA result which uses scoped-noalias metadata to answer queries.
void setPreservesAll()
Set by analyses that do not transform their input at all.
MDNode * NoAlias
The tag specifying the noalias scope.
ImmutablePass * createScopedNoAliasAAWrapperPass()
ScopedNoAliasAAResult run(Function &F, FunctionAnalysisManager &AM)
Legacy wrapper pass to provide the ScopedNoAliasAAResult object.
This is a simple wrapper around an MDNode which provides a higher-level interface by hiding the detai...
LLVM_NODISCARD bool empty() const
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
A container for analyses that lazily runs them and caches their results.
Tracking metadata reference owned by Metadata.
Representation for a specific memory location.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.