38 #ifndef LLVM_ANALYSIS_ALIASANALYSIS_H
39 #define LLVM_ANALYSIS_ALIASANALYSIS_H
52 class TargetLibraryInfo;
55 class MemTransferInst;
135 const Value *
V2, uint64_t V2Size) {
153 const Value *
V2, uint64_t V2Size) {
177 bool OrLocal =
false);
347 case Instruction::AtomicCmpXchg:
349 case Instruction::AtomicRMW:
359 const Value *
P, uint64_t Size) {
370 const Value *
P, uint64_t Size) {
393 const Value *
P, uint64_t Size) {
435 const Value *
P,
unsigned Size) {
446 const Value *
P,
unsigned Size) {
void replaceWithNewValue(Value *Old, Value *New)
replaceWithNewValue - This method is the obvious combination of the two above, and it provided as a h...
Pass interface - Implemented by all 'passes'.
The two locations precisely alias each other.
ModRefResult getModRefInfo(ImmutableCallSite CS, const Value *P, uint64_t Size)
getModRefInfo (for call sites) - A convenience wrapper.
A parsed version of the target data layout string in and methods for querying it. ...
bool onlyReadsMemory(const Function *F)
onlyReadsMemory - If the specified function is known to only read from non-volatile memory (or not ac...
ModRefResult callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
callCapturesBefore - Return information about whether a particular call site modifies or reads the sp...
FenceInst - an instruction for ordering other memory operations.
AtomicCmpXchgInst - an instruction that atomically checks whether a specified value is in a memory lo...
The two locations alias, but only due to a partial overlap.
ModRefBehavior
ModRefBehavior - Summary of how a function affects memory in the program.
CallInst - This class represents a function call, abstracting a target machine's calling convention...
AliasResult alias(const Value *V1, uint64_t V1Size, const Value *V2, uint64_t V2Size)
alias - A convenience wrapper.
ModRefResult getModRefInfo(const AtomicCmpXchgInst *CX, const Value *P, unsigned Size)
getModRefInfo (for cmpxchges) - A convenience wrapper.
The two locations do not alias at all.
bool isNoAliasCall(const Value *V)
isNoAliasCall - Return true if this pointer is returned by a noalias function.
LoadInst - an instruction for reading from memory.
AtomicRMWInst - an instruction that atomically reads a memory location, combines it with another valu...
ModRefResult callCapturesBefore(const Instruction *I, const Value *P, uint64_t Size, DominatorTree *DT)
callCapturesBefore - A convenience wrapper.
The two locations may or may not alias. This is the least precise result.
virtual bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal=false)
pointsToConstantMemory - If the specified memory location is known to be constant, return true.
bool isMustAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
isMustAlias - A convenience wrapper.
ModRefResult getModRefInfo(const Instruction *I, const MemoryLocation &Loc)
getModRefInfo - Return information about whether or not an instruction may read or write the specifie...
A Use represents the edge between a Value definition and its users.
OnlyReadsMemory - This function does not perform any non-local stores or volatile loads...
ModRefResult getModRefInfo(const LoadInst *L, const Value *P, uint64_t Size)
getModRefInfo (for loads) - A convenience wrapper.
virtual ModRefResult getArgModRefInfo(ImmutableCallSite CS, unsigned ArgIdx)
Get the ModRef info associated with a pointer argument of a callsite.
bool isIdentifiedObject(const Value *V)
isIdentifiedObject - Return true if this pointer refers to a distinct and identifiable object...
bool doesNotAccessMemory(const Function *F)
doesNotAccessMemory - If the specified function is known to never read or write memory, return true.
bool isNoAlias(const Value *V1, uint64_t V1Size, const Value *V2, uint64_t V2Size)
isNoAlias - A convenience wrapper.
virtual void addEscapingUse(Use &U)
addEscapingUse - This method should be used whenever an escaping use is added to a pointer value...
uint64_t getTypeStoreSize(Type *Ty)
getTypeStoreSize - Return the DataLayout store size for the given type, if known, or a conservative v...
ModRefResult getModRefInfo(const AtomicRMWInst *RMW, const Value *P, unsigned Size)
getModRefInfo (for atomicrmws) - A convenience wrapper.
StoreInst - an instruction for storing to memory.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
bool onlyReadsMemory(ImmutableCallSite CS)
onlyReadsMemory - If the specified call is known to only read from non-volatile memory (or not access...
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
OnlyAccessesArgumentPointees - The only memory references in this function (if it has any) are non-vo...
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const Value *Ptr, uint64_t Size, const ModRefResult Mode)
canInstructionRangeModRef - A convenience wrapper.
AliasResult
The possible results of an alias query.
Represent the analysis usage information of a pass.
const TargetLibraryInfo * TLI
bool doesNotAccessMemory(ImmutableCallSite CS)
doesNotAccessMemory - If the specified call is known to never read or write memory, return true.
ModRefResult getModRefInfo(const FenceInst *S, const Value *P, uint64_t Size)
getModRefInfo (for fences) - A convenience wrapper.
static bool doesAccessArgPointees(ModRefBehavior MRB)
doesAccessArgPointees - Return true if functions with the specified behavior are known to potentially...
ModRefResult getModRefInfo(const CallInst *C, const MemoryLocation &Loc)
getModRefInfo (for calls) - Return information about whether a particular call modifies or reads the ...
VAArgInst - This class represents the va_arg llvm instruction, which returns an argument of the speci...
virtual void deleteValue(Value *V)
Methods that clients should call when they transform the program to allow alias analyses to update th...
OnlyReadsArgumentPointees - The only memory references in this function (if it has any) are non-volat...
virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS)
getModRefBehavior - Return the behavior when calling the given call site.
ModRefResult getModRefInfo(const CallInst *C, const Value *P, uint64_t Size)
getModRefInfo (for calls) - A convenience wrapper.
bool isIdentifiedFunctionLocal(const Value *V)
isIdentifiedFunctionLocal - Return true if V is umabigously identified at the function-level.
Representation for a specific memory location.
bool canBasicBlockModify(const BasicBlock &BB, const Value *P, uint64_t Size)
canBasicBlockModify - A convenience wrapper.
bool isMustAlias(const Value *V1, const Value *V2)
isMustAlias - A convenience wrapper.
virtual AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
Alias Queries...
Provides information about what library functions are available for the current target.
ModRefResult getModRefInfo(const Instruction *I)
getModRefInfo - Return information about whether or not an instruction may read or write memory (with...
ModRefResult getModRefInfo(const InvokeInst *I, const Value *P, uint64_t Size)
getModRefInfo (for invokes) - A convenience wrapper.
void InitializeAliasAnalysis(Pass *P, const DataLayout *DL)
InitializeAliasAnalysis - Subclasses must call this method to initialize the AliasAnalysis interface ...
ModRefResult getModRefInfo(const InvokeInst *I, const MemoryLocation &Loc)
getModRefInfo (for invokes) - Return information about whether a particular invoke modifies or reads ...
bool isNoAlias(const Value *V1, const Value *V2)
isNoAlias - A convenience wrapper.
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const MemoryLocation &Loc, const ModRefResult Mode)
canInstructionRangeModRef - Return true if it is possible for the execution of the specified instruct...
ModRefResult getModRefInfo(const StoreInst *S, const Value *P, uint64_t Size)
getModRefInfo (for stores) - A convenience wrapper.
static bool onlyAccessesArgPointees(ModRefBehavior MRB)
onlyAccessesArgPointees - Return true if functions with the specified behavior are known to read and ...
This file provides utility analysis objects describing memory locations.
ImmutableCallSite - establish a view to a call site for examination.
bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc)
Higher level methods for querying mod/ref information.
DoesNotAccessMemory - This function does not perform any non-local loads or stores to memory...
LLVM Value Representation.
ModRefResult
Simple mod/ref information...
unsigned getOpcode() const
getOpcode() returns a member of one of the enums like Instruction::Add.
ModRefResult getModRefInfo(const Instruction *I, const Value *P, uint64_t Size)
getModRefInfo - A convenience wrapper.
virtual void getAnalysisUsage(AnalysisUsage &AU) const
getAnalysisUsage - All alias analysis implementations should invoke this directly (using AliasAnalysi...
InvokeInst - Invoke instruction.
const TargetLibraryInfo * getTargetLibraryInfo() const
getTargetLibraryInfo - Return a pointer to the current TargetLibraryInfo object, or null if no Target...
bool isNoAliasArgument(const Value *V)
isNoAliasArgument - Return true if this is an argument with the noalias attribute.
bool isNoAlias(const MemoryLocation &LocA, const MemoryLocation &LocB)
isNoAlias - A trivial helper function to check to see if the specified pointers are no-alias...
bool pointsToConstantMemory(const Value *P, bool OrLocal=false)
pointsToConstantMemory - A convenient wrapper.
AliasResult alias(const Value *V1, const Value *V2)
alias - A convenience wrapper.
UnknownModRefBehavior - This indicates that the function could not be classified into one of the beha...
static bool onlyReadsMemory(ModRefBehavior MRB)
onlyReadsMemory - Return true if functions with the specified behavior are known to only read from no...
ModRefResult getModRefInfo(const FenceInst *S, const MemoryLocation &Loc)
getModRefInfo (for fences) - Return information about whether a particular store modifies or reads th...
ModRefResult getModRefInfo(const VAArgInst *I, const Value *P, uint64_t Size)
getModRefInfo (for va_args) - A convenience wrapper.