53 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
54 return AA->alias(LocA, LocB);
59 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
65 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
70 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
75 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
99 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
110 bool doesAlias =
false;
115 const Value *Arg = *AI;
118 unsigned ArgIdx = std::distance(CS.
arg_begin(), AI);
139 if (!AA)
return Mask;
148 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
179 unsigned CS2ArgIdx = std::distance(CS2.
arg_begin(),
I);
187 else if (ArgMask == Ref)
208 unsigned CS1ArgIdx = std::distance(CS1.
arg_begin(),
I);
228 if (!AA)
return Mask;
237 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
256 assert(AA &&
"AA didn't call InitializeAliasAnalysis in its run method!");
360 isa<Constant>(Object))
375 CI != CE; ++CI, ++ArgNo) {
379 if (!(*CI)->getType()->isPointerTy() ||
413 TLI = TLIP ? &TLIP->getTLI() :
nullptr;
448 "Instructions not in same basic block!");
462 if (isa<CallInst>(V) || isa<InvokeInst>(V))
472 if (
const Argument *
A = dyn_cast<Argument>(V))
473 return A->hasNoAliasAttr();
485 if (isa<AllocaInst>(V))
487 if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V))
491 if (
const Argument *
A = dyn_cast<Argument>(V))
492 return A->hasNoAliasAttr() ||
A->hasByValAttr();
Pass interface - Implemented by all 'passes'.
A parsed version of the target data layout string in and methods for querying it. ...
LLVM Argument representation.
const Instruction & back() const
ModRefResult callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
callCapturesBefore - Return information about whether a particular call site modifies or reads the sp...
AtomicOrdering getSuccessOrdering() const
Returns the ordering constraint on this cmpxchg.
InstrTy * getInstruction() const
AtomicCmpXchgInst - an instruction that atomically checks whether a specified value is in a memory lo...
ModRefBehavior
ModRefBehavior - Summary of how a function affects memory in the program.
const Instruction & front() const
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...
virtual bool pointsToConstantMemory(const MemoryLocation &Loc, bool OrLocal=false)
pointsToConstantMemory - If the specified memory location is known to be constant, return true.
AnalysisUsage & addRequired()
AnalysisType * getAnalysisIfAvailable() const
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information tha...
A Use represents the edge between a Value definition and its users.
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...
AtomicOrdering getOrdering() const
Returns the ordering constraint on this RMW.
#define INITIALIZE_ANALYSIS_GROUP(agName, name, defaultPass)
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...
StoreInst - an instruction for storing to memory.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Considered to not alias after call.
bool onlyReadsMemory(ImmutableCallSite CS)
onlyReadsMemory - If the specified call is known to only read from non-volatile memory (or not access...
bool doesNotAccessMemory() const
Determine if the call does not access memory.
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
FunTy * getCalledFunction() const
getCalledFunction - Return the function being called if this is a direct call, otherwise return null ...
bool isByValArgument(unsigned ArgNo) const
Determine whether this argument is passed by value.
AliasResult
The possible results of an alias query.
Represent the analysis usage information of a pass.
const TargetLibraryInfo * TLI
static bool doesAccessArgPointees(ModRefBehavior MRB)
doesAccessArgPointees - Return true if functions with the specified behavior are known to potentially...
bool isPointerTy() const
isPointerTy - True if this is an instance of PointerType.
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...
virtual ModRefBehavior getModRefBehavior(ImmutableCallSite CS)
getModRefBehavior - Return the behavior when calling the given call site.
Value * GetUnderlyingObject(Value *V, const DataLayout &DL, unsigned MaxLookup=6)
GetUnderlyingObject - This method strips off any GEP address adjustments and pointer casts from the s...
static MemoryLocation getForArgument(ImmutableCallSite CS, unsigned ArgIdx, const TargetLibraryInfo &TLI)
Return a location representing a particular argument of a call.
bool isIdentifiedFunctionLocal(const Value *V)
isIdentifiedFunctionLocal - Return true if V is umabigously identified at the function-level.
const Value * Ptr
The address of the start of the location.
Representation for a specific memory location.
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
bool paramHasAttr(unsigned i, Attribute::AttrKind A) const
Return true if the call or the callee has the given attribute.
virtual AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
Alias Queries...
Type * getType() const
All values are typed, get the type of this value.
ModRefResult getModRefInfo(const Instruction *I)
getModRefInfo - Return information about whether or not an instruction may read or write memory (with...
void InitializeAliasAnalysis(Pass *P, const DataLayout *DL)
InitializeAliasAnalysis - Subclasses must call this method to initialize the AliasAnalysis interface ...
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...
bool doesNotCapture(unsigned ArgNo) const
Determine whether this argument is not captured.
static bool onlyAccessesArgPointees(ModRefBehavior MRB)
onlyAccessesArgPointees - Return true if functions with the specified behavior are known to read and ...
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...
uint64_t getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type...
LLVM Value Representation.
ModRefResult
Simple mod/ref information...
virtual void getAnalysisUsage(AnalysisUsage &AU) const
getAnalysisUsage - All alias analysis implementations should invoke this directly (using AliasAnalysi...
IterTy arg_begin() const
arg_begin/arg_end - Return iterators corresponding to the actual argument list for a call site...
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...
UnknownModRefBehavior - This indicates that the function could not be classified into one of the beha...
const BasicBlock * getParent() const
bool onlyReadsMemory() const
Determine if the call does not access or only reads memory.
bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures, bool StoreCaptures, const Instruction *I, DominatorTree *DT, bool IncludeI=false)
PointerMayBeCapturedBefore - Return true if this pointer value may be captured by the enclosing funct...