Go to the documentation of this file.
37 #ifndef LLVM_ANALYSIS_ALIASANALYSIS_H
38 #define LLVM_ANALYSIS_ALIASANALYSIS_H
54 class AtomicCmpXchgInst;
58 class CatchReturnInst;
63 class PreservedAnalyses;
64 class TargetLibraryInfo;
66 template <
typename>
class SmallPtrSetImpl;
83 static const int OffsetBits = 23;
84 static const int AliasBits = 8;
85 static_assert(AliasBits + 1 + OffsetBits <= 32,
86 "AliasResult size is intended to be 4 bytes!");
88 unsigned int Alias : AliasBits;
89 unsigned int HasOffset : 1;
90 signed int Offset : OffsetBits;
108 static_assert(
MustAlias < (1 << AliasBits),
109 "Not enough bit field size for the enum!");
113 : Alias(Alias), HasOffset(
false), Offset(0) {}
115 operator Kind()
const {
return static_cast<Kind>(Alias); }
119 assert(HasOffset &&
"No offset!");
123 if (isInt<OffsetBits>(NewOffset)) {
130 void swap(
bool DoSwap =
true) {
136 static_assert(
sizeof(AliasResult) == 4,
137 "AliasResult size is intended to be 4 bytes!");
140 raw_ostream &
operator<<(raw_ostream &OS, AliasResult AR);
234 return ModRefInfo(
static_cast<int>(MRI1) |
static_cast<int>(MRI2));
238 return ModRefInfo(
static_cast<int>(MRI1) &
static_cast<int>(MRI2));
421 : DT(DT), LI(LI), EphValues(EphValues) {}
464 using LocPair = std::pair<AACacheLoc, AACacheLoc>;
509 class BatchAAResults;
520 template <
typename AAResultT>
void addAAResult(AAResultT &AAResult) {
524 AAs.emplace_back(
new Model<AAResultT>(AAResult, *
this));
900 bool OrLocal =
false);
938 std::vector<std::unique_ptr<Concept>> AAs;
940 std::vector<AnalysisKey *> AADeps;
961 return AA.alias(LocA, LocB, AAQI);
964 return AA.pointsToConstantMemory(Loc, AAQI, OrLocal);
967 return AA.getModRefInfo(Call, Loc, AAQI);
970 return AA.getModRefInfo(Call1, Call2, AAQI);
974 return AA.getModRefInfo(
I, OptLoc, AAQI);
977 return AA.getModRefInfo(
I, Call2, AAQI);
980 return AA.getArgModRefInfo(Call, ArgIdx);
983 return AA.getModRefBehavior(Call);
996 return AA.callCapturesBefore(
I, MemLoc, DT, AAQI);
1048 unsigned ArgIdx) = 0;
1081 explicit Model(AAResultT &Result,
AAResults &AAR) : Result(Result) {
1082 Result.setAAResults(&AAR);
1084 ~
Model()
override =
default;
1086 void setAAResults(
AAResults *NewAAR)
override { Result.setAAResults(NewAAR); }
1088 AliasResult
alias(
const MemoryLocation &LocA,
const MemoryLocation &LocB,
1089 AAQueryInfo &AAQI)
override {
1090 return Result.alias(LocA, LocB, AAQI);
1094 bool OrLocal)
override {
1095 return Result.pointsToConstantMemory(Loc, AAQI, OrLocal);
1099 return Result.getArgModRefInfo(Call, ArgIdx);
1103 return Result.getModRefBehavior(Call);
1107 return Result.getModRefBehavior(
F);
1111 AAQueryInfo &AAQI)
override {
1112 return Result.getModRefInfo(Call, Loc, AAQI);
1116 AAQueryInfo &AAQI)
override {
1117 return Result.getModRefInfo(Call1, Call2, AAQI);
1145 DerivedT &derived() {
return static_cast<DerivedT &
>(*this); }
1149 void setAAResults(
AAResults *NewAAR) { AAR = NewAAR; }
1157 DerivedT &CurrentResult;
1161 : AAR(AAR), CurrentResult(CurrentResult) {}
1165 return AAR ? AAR->
alias(LocA, LocB, AAQI)
1166 : CurrentResult.alias(LocA, LocB, AAQI);
1172 : CurrentResult.pointsToConstantMemory(Loc, AAQI, OrLocal);
1177 : CurrentResult.getArgModRefInfo(Call, ArgIdx);
1182 : CurrentResult.getModRefBehavior(Call);
1192 : CurrentResult.getModRefInfo(Call, Loc, AAQI);
1198 : CurrentResult.getModRefInfo(Call1, Call2, AAQI);
1280 bool &RequiresNoCaptureBeforeUnwind);
1305 ResultGetters.push_back(&getFunctionAAResultImpl<AnalysisT>);
1310 ResultGetters.push_back(&getModuleAAResultImpl<AnalysisT>);
1324 template <
typename AnalysisT>
1325 static void getFunctionAAResultImpl(
Function &
F,
1332 template <
typename AnalysisT>
1334 AAResults &AAResults) {
1337 MAMProxy.template getCachedResult<AnalysisT>(*
F.getParent())) {
1338 AAResults.addAAResult(*R);
1340 .template registerOuterAnalysisInvalidation<AnalysisT, AAManager>();
1348 std::unique_ptr<AAResults> AAR;
1408 #endif // LLVM_ANALYSIS_ALIASANALYSIS_H
void addAAResult(AAResultT &AAResult)
Register a specific AA result.
void addAADependencyID(AnalysisKey *ID)
Register a function analysis ID that the results aggregation depends on.
A set of analyses that are preserved following a run of a transformation pass.
This class is a wrapper over an AAResults, and it is intended to be used only when there are no IR ch...
int NumAssumptionUses
Number of times a NoAlias assumption has been used.
bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool OrLocal)
@ NoModRef
The access neither references nor modifies the value stored in memory.
A manager for alias analyses.
@ MayAlias
The two locations may or may not alias.
void removeInstruction(Instruction *I)
@ PartialAlias
The two locations alias, but only due to a partial overlap.
This is an optimization pass for GlobalISel generic memory operations.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
print lazy value Lazy Value Info Printer Pass
virtual ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)=0
Get the ModRef info associated with a pointer argument of a callsite.
Context-free CaptureInfo provider, which computes and caches whether an object is captured in the fun...
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
@ FMRB_OnlyReadsInaccessibleMem
The only memory references in this function (if it has any) are reads of memory that is otherwise ina...
LLVM_NODISCARD bool isModAndRefSet(const ModRefInfo MRI)
Virtual base class for providers of capture information.
LLVM_NODISCARD bool isModOrRefSet(const ModRefInfo MRI)
ImmutablePass class - This class is used to provide information that does not need to be run.
virtual bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool OrLocal)=0
Checks whether the given location points to constant memory, or if OrLocal is true whether it points ...
OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
bool canBasicBlockModify(const BasicBlock &BB, const Value *P, LocationSize Size)
A convenience wrapper synthesizing a memory location.
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
Handle invalidation events in the new pass manager.
FunctionPass * createAAResultsWrapperPass()
ModRefInfo getModRefInfo(const Instruction *I, const Optional< MemoryLocation > &OptLoc)
Context-sensitive CaptureInfo provider, which computes and caches the earliest common dominator closu...
bool isNoAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
A trivial helper function to check to see if the specified pointers are no-alias.
LLVM_NODISCARD ModRefInfo createModRefInfo(const FunctionModRefBehavior FMRB)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
static bool onlyAccessesArgPointees(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to read and write at most from objects poin...
AAQueryInfo that uses SimpleCaptureInfo.
bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal=false)
ModRefInfo getModRefInfo(const StoreInst *S, const Value *P, LocationSize Size)
getModRefInfo (for stores) - A convenience wrapper.
virtual ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)=0
getModRefInfo (for call sites) - Return information about whether a particular call site modifies or ...
This proxy class models a common pattern where we delegate to either the top-level AAResults aggregat...
bool isDefinitive() const
Whether this is a definitive (non-assumption) result.
An instruction for ordering other memory operations.
The possible results of an alias query.
static unsigned getHashValue(const AACacheLoc &Val)
@ FMRL_Anywhere
Access to any memory.
@ FMRB_UnknownModRefBehavior
This indicates that the function could not be classified into one of the behaviors above.
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc)
FunctionModRefBehavior getModRefBehavior(const CallBase *Call)
ModRefInfo getModRefInfo(const Instruction *I, const Value *P, LocationSize Size)
A convenience wrapper for constructing the memory location.
@ Must
Must is provided for completeness, but no routines will return only Must today.
void getAAResultsAnalysisUsage(AnalysisUsage &AU)
A helper for the legacy pass manager to populate AU to add uses to make sure the analyses required by...
@ FMRB_OnlyAccessesInaccessibleMem
The only memory references in this function (if it has any) are references of memory that is otherwis...
LLVM Basic Block Representation.
virtual AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)=0
The main low level interface to the alias analysis implementation.
bool isIdentifiedFunctionLocal(const Value *V)
Return true if V is umabigously identified at the function-level.
AAResults(const TargetLibraryInfo &TLI)
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.
@ FMRB_OnlyAccessesInaccessibleOrArgMem
The function may perform non-volatile loads and stores of objects pointed to by its pointer-typed arg...
@ FMRB_OnlyWritesInaccessibleOrArgMem
The function may perform non-volatile stores to objects pointed to by its pointer-typed arguments,...
An information struct used to provide DenseMap with the various necessary components for a given valu...
FunctionModRefBehavior getModRefBehavior(const Function *F)
@ MustRef
The access may reference the value stored in memory, a mustAlias relation was found,...
ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2)
bool isNoAliasCall(const Value *V)
Return true if this pointer is returned by a noalias function.
bool pointsToConstantMemory(const Value *P, bool OrLocal=false)
A convenience wrapper around the primary pointsToConstantMemory interface.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool onlyReadsMemory(const CallBase *Call)
Checks if the specified call is known to only read from non-volatile memory (or not access memory at ...
@ Ref
The access may reference the value stored in memory.
@ FMRB_OnlyReadsArgumentPointees
The only memory references in this function (if it has any) are non-volatile loads from objects point...
@ MustModRef
The access may reference, modify or both the value stored in memory, a mustAlias relation was found,...
@ MustMod
The access may modify the value stored in memory, a mustAlias relation was found, and no mayAlias or ...
bool isNotCapturedBeforeOrAt(const Value *Object, const Instruction *I) override
Represent the analysis usage information of a pass.
constexpr bool hasOffset() const
ModRefInfo getModRefInfo(const VAArgInst *I, const Value *P, LocationSize Size)
getModRefInfo (for va_args) - A convenience wrapper.
@ FMRL_ArgumentPointees
Access to memory via argument pointers.
ModRefInfo getModRefInfo(const CatchReturnInst *I, const Value *P, LocationSize Size)
getModRefInfo (for catchrets) - A convenience wrapper.
static bool onlyWritesMemory(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to only write memory (or not access memory ...
A private abstract base class describing the concept of an individual alias analysis implementation.
std::function< void(Pass &, Function &, AAResults &)> CallbackT
Result run(Function &F, FunctionAnalysisManager &AM)
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
SmallVector< AAQueryInfo::LocPair, 4 > AssumptionBasedResults
Location pairs for which an assumption based result is currently stored.
static LocationSize precise(uint64_t Value)
LLVM_NODISCARD ModRefInfo clearRef(const ModRefInfo MRI)
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
BatchAAResults(AAResults &AAR, CaptureInfo *CI)
API to communicate dependencies between analyses during invalidation.
LLVM_NODISCARD bool isModSet(const ModRefInfo MRI)
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
static AACacheLoc getTombstoneKey()
AAResults createLegacyPMAAResults(Pass &P, Function &F, BasicAAResult &BAR)
A helper for the legacy pass manager to create a AAResults object populated to the best of our abilit...
constexpr int32_t getOffset() const
ModRefInfo getModRefInfo(const CatchPadInst *I, const Value *P, LocationSize Size)
getModRefInfo (for catchpads) - A convenience wrapper.
LLVM_NODISCARD ModRefInfo clearMod(const ModRefInfo MRI)
LLVM_NODISCARD ModRefInfo setRef(const ModRefInfo MRI)
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
LLVM_NODISCARD ModRefInfo clearMust(const ModRefInfo MRI)
std::pair< AACacheLoc, AACacheLoc > LocPair
bool onlyReadsMemory(const Function *F)
Checks if the specified function is known to only read from non-volatile memory (or not access memory...
FunctionModRefLocation
The locations at which a function might access memory.
virtual bool isNotCapturedBeforeOrAt(const Value *Object, const Instruction *I)=0
An instruction for storing to memory.
LLVM_NODISCARD bool isNoModRef(const ModRefInfo MRI)
ModRefInfo getModRefInfo(const AtomicRMWInst *RMW, const Value *P, LocationSize Size)
getModRefInfo (for atomicrmws) - A convenience wrapper.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
@ FMRB_OnlyAccessesArgumentPointees
The only memory references in this function (if it has any) are non-volatile loads and stores from ob...
@ FMRB_OnlyWritesArgumentPointees
The only memory references in this function (if it has any) are non-volatile stores from objects poin...
FunctionModRefBehavior getModRefBehavior(const Function *F)
int NumAssumptionUses
How many active NoAlias assumption uses there are.
A special type used by analysis passes to provide an address that identifies that particular analysis...
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const MemoryLocation &Loc, const ModRefInfo Mode)
Check if it is possible for the execution of the specified instructions to mod(according to the mode)...
virtual FunctionModRefBehavior getModRefBehavior(const CallBase *Call)=0
Return the behavior of the given call site.
ModRefInfo getModRefInfo(const Instruction *I, const Optional< MemoryLocation > &OptLoc)
Check whether or not an instruction may read or write the optionally specified memory location.
LLVM_NODISCARD ModRefInfo unionModRef(const ModRefInfo MRI1, const ModRefInfo MRI2)
ImmutablePass * createExternalAAWrapperPass(std::function< void(Pass &, Function &, AAResults &)> Callback)
A wrapper pass around a callback which can be used to populate the AAResults in the AAResultsWrapperP...
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void setOffset(int32_t NewOffset)
static bool doesAccessArgPointees(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to potentially read or write from objects p...
ModRefInfo getModRefInfo(const FenceInst *S, const Value *P, LocationSize Size)
getModRefInfo (for fences) - A convenience wrapper.
@ BasicBlock
Various leaf nodes.
print Print MemDeps of function
EarliestEscapeInfo(DominatorTree &DT, const LoopInfo &LI, const SmallPtrSetImpl< const Value * > &EphValues)
@ FMRB_DoesNotAccessMemory
This function does not perform any non-local loads or stores to memory.
ModRefInfo getModRefInfo(const CallBase *Call, const Value *P, LocationSize Size)
getModRefInfo (for call sites) - A convenience wrapper.
A CRTP mix-in that provides informational APIs needed for analysis passes.
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
FunctionModRefBehavior getModRefBehavior(const CallBase *Call)
@ FMRL_InaccessibleMem
Memory that is inaccessible via LLVM IR.
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const Value *Ptr, LocationSize Size, const ModRefInfo Mode)
A convenience wrapper synthesizing a memory location.
AAResultBase(AAResultBase &&Arg)
bool isMustAlias(const Value *V1, const Value *V2)
A convenience wrapper around the isMustAlias helper interface.
void swap(bool DoSwap=true)
Helper for processing AliasResult for swapped memory location pairs.
const AAResults & getAAResults() const
static bool doesAccessInaccessibleMem(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to potentially read or write from memory th...
void registerModuleAnalysis()
Register a specific AA result.
@ FMRB_OnlyReadsInaccessibleOrArgMem
The function may perform non-volatile loads from objects pointed to by its pointer-typed arguments,...
bool isNoAlias(const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
A convenience wrapper around the isNoAlias helper interface.
bool isNotVisibleOnUnwind(const Value *Object, bool &RequiresNoCaptureBeforeUnwind)
Return true if Object memory is not visible after an unwind, in the sense that program semantics cann...
BatchAAResults(AAResults &AAR)
@ FMRB_OnlyReadsMemory
This function does not perform any non-local stores or volatile loads, but may read from any memory l...
@ NoAlias
The two locations do not alias at all.
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
@ Mod
The access may modify the value stored in memory.
LLVM_NODISCARD ModRefInfo setModAndRef(const ModRefInfo MRI)
@ MustAlias
The two locations precisely alias each other.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
FunctionModRefBehavior
Summary of how a function affects memory in the program.
ModRefInfo getModRefInfo(Instruction *I, const CallBase *Call2)
AliasResult alias(const Value *V1, const Value *V2)
A convenience wrapper around the primary alias interface.
An instruction for reading from memory.
bool isNotCapturedBeforeOrAt(const Value *Object, const Instruction *I) override
bool isNoAlias(const Value *V1, const Value *V2)
A convenience wrapper around the isNoAlias helper interface.
FunctionModRefBehavior getModRefBehavior(const CallBase *Call)
Return the behavior of the given call site.
static bool onlyAccessesInaccessibleOrArgMem(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to read and write at most from memory that ...
an instruction that atomically reads a memory location, combines it with another value,...
unsigned const MachineRegisterInfo * MRI
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
ModRefInfo getModRefInfo(const LoadInst *L, const Value *P, LocationSize Size)
getModRefInfo (for loads) - A convenience wrapper.
AAQueryInfo(CaptureInfo *CI)
FunctionModRefBehavior getModRefBehavior(const CallBase *Call)
bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
@ FMRL_Nowhere
Base case is no access to memory.
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
bool isIdentifiedObject(const Value *V)
Return true if this pointer refers to a distinct and identifiable object.
bool doesNotAccessMemory(const Function *F)
Checks if the specified function is known to never read or write memory.
void setPreservesAll()
Set by analyses that do not transform their input at all.
AAResultsProxy(AAResults *AAR, DerivedT &CurrentResult)
LLVM_NODISCARD bool isMustSet(const ModRefInfo MRI)
Reduced version of MemoryLocation that only stores a pointer and size.
static bool onlyAccessesInaccessibleMem(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to read and write at most from memory that ...
bool runOnFunction(Function &F) override
Run the wrapper pass to rebuild an aggregation over known AA passes.
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
@ FMRB_OnlyWritesInaccessibleMem
The only memory references in this function (if it has any) are writes to memory that is otherwise in...
bool isMustAlias(const Value *V1, const Value *V2)
Provides information about what library functions are available for the current target.
ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
The main low level interface to the alias analysis implementation.
ModRefInfo callCapturesBefore(const Instruction *I, const Value *P, LocationSize Size, DominatorTree *DT)
A convenience wrapper to synthesize a memory location.
bool pointsToConstantMemory(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool OrLocal)
bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal=false)
Checks whether the given location points to constant memory, or if OrLocal is true whether it points ...
static AACacheLoc getEmptyKey()
void registerFunctionAnalysis()
Register a specific AA result.
AAQueryInfo withEmptyCache()
Create a new AAQueryInfo based on this one, but with the cache cleared.
AAResults & getAAResults()
constexpr AliasResult(const Kind &Alias)
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
Get the ModRef info associated with a pointer argument of a call.
AAResultBase(const AAResultBase &Arg)
AAResultsProxy getBestAAResults()
Get a proxy for the best AA result set to query at this time.
Pass interface - Implemented by all 'passes'.
bool doesNotAccessMemory(const CallBase *Call)
Checks if the specified call is known to never read or write memory.
LLVM_NODISCARD bool isRefSet(const ModRefInfo MRI)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AliasResult alias(const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
A convenience wrapper around the primary alias interface.
static bool isEqual(const AACacheLoc &LHS, const AACacheLoc &RHS)
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object.
A wrapper pass for external alias analyses.
ModRefInfo callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
LLVM_NODISCARD ModRefInfo setMust(const ModRefInfo MRI)
bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
A trivial helper function to check to see if the specified pointers are must-alias.
bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc)
Check if it is possible for execution of the specified basic block to modify the location Loc.
static bool onlyReadsMemory(FunctionModRefBehavior MRB)
Checks if functions with the specified behavior are known to only read from non-volatile memory (or n...
ModRefInfo callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
Return information about whether a particular call site modifies or reads the specified memory locati...
static MemoryLocation getBeforeOrAfter(const Value *Ptr, const AAMDNodes &AATags=AAMDNodes())
Return a location that may access any location before or after Ptr, while remaining within the underl...
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.
FunctionPass class - This class is used to implement most global optimizations.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
LLVM_NODISCARD ModRefInfo intersectModRef(const ModRefInfo MRI1, const ModRefInfo MRI2)
virtual void setAAResults(AAResults *NewAAR)=0
An update API used internally by the AAResults to provide a handle back to the top level aggregation.
LLVM Value Representation.
An instruction that atomically checks whether a specified value is in a memory location,...
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc)
getModRefInfo (for call sites) - Return information about whether a particular call site modifies or ...
A CRTP-driven "mixin" base class to help implement the function alias analysis results concept.
@ ModRef
The access may reference and may modify the value stored in memory.
Representation for a specific memory location.
ModRefInfo getModRefInfo(const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)
unsigned Depth
Query depth used to distinguish recursive queries.
LLVM_NODISCARD ModRefInfo setMod(const ModRefInfo MRI)
ModRefInfo getModRefInfo(const AtomicCmpXchgInst *CX, const Value *P, LocationSize Size)
getModRefInfo (for cmpxchges) - A convenience wrapper.