LLVM API Documentation
#include <AliasAnalysis.h>
Classes | |
struct | Location |
Location - A description of a memory location. More... | |
Public Types | |
enum | AliasResult { NoAlias = 0, MayAlias, PartialAlias, MustAlias } |
enum | ModRefResult { NoModRef = 0, Ref = 1, Mod = 2, ModRef = 3 } |
enum | { Nowhere = 0, ArgumentPointees = 4, Anywhere = 8 | ArgumentPointees } |
enum | ModRefBehavior { DoesNotAccessMemory = Nowhere | NoModRef, OnlyReadsArgumentPointees = ArgumentPointees | Ref, OnlyAccessesArgumentPointees = ArgumentPointees | ModRef, OnlyReadsMemory = Anywhere | Ref, UnknownModRefBehavior = Anywhere | ModRef } |
Public Member Functions | |
AliasAnalysis () | |
virtual | ~AliasAnalysis () |
const DataLayout * | getDataLayout () const |
const TargetLibraryInfo * | getTargetLibraryInfo () const |
uint64_t | getTypeStoreSize (Type *Ty) |
Location | getLocation (const LoadInst *LI) |
Location | getLocation (const StoreInst *SI) |
Location | getLocation (const VAArgInst *VI) |
Location | getLocation (const AtomicCmpXchgInst *CXI) |
Location | getLocation (const AtomicRMWInst *RMWI) |
virtual AliasResult | alias (const Location &LocA, const Location &LocB) |
AliasResult | alias (const Value *V1, uint64_t V1Size, const Value *V2, uint64_t V2Size) |
alias - A convenience wrapper. More... | |
AliasResult | alias (const Value *V1, const Value *V2) |
alias - A convenience wrapper. More... | |
bool | isNoAlias (const Location &LocA, const Location &LocB) |
bool | isNoAlias (const Value *V1, uint64_t V1Size, const Value *V2, uint64_t V2Size) |
isNoAlias - A convenience wrapper. More... | |
bool | isNoAlias (const Value *V1, const Value *V2) |
isNoAlias - A convenience wrapper. More... | |
bool | isMustAlias (const Location &LocA, const Location &LocB) |
isMustAlias - A convenience wrapper. More... | |
bool | isMustAlias (const Value *V1, const Value *V2) |
isMustAlias - A convenience wrapper. More... | |
virtual bool | pointsToConstantMemory (const Location &Loc, bool OrLocal=false) |
bool | pointsToConstantMemory (const Value *P, bool OrLocal=false) |
pointsToConstantMemory - A convenient wrapper. More... | |
virtual ModRefBehavior | getModRefBehavior (ImmutableCallSite CS) |
getModRefBehavior - Return the behavior when calling the given call site. More... | |
virtual ModRefBehavior | getModRefBehavior (const Function *F) |
bool | doesNotAccessMemory (ImmutableCallSite CS) |
bool | doesNotAccessMemory (const Function *F) |
bool | onlyReadsMemory (ImmutableCallSite CS) |
bool | onlyReadsMemory (const Function *F) |
ModRefResult | getModRefInfo (const Instruction *I, const Location &Loc) |
ModRefResult | getModRefInfo (const Instruction *I, const Value *P, uint64_t Size) |
getModRefInfo - A convenience wrapper. More... | |
virtual ModRefResult | getModRefInfo (ImmutableCallSite CS, const Location &Loc) |
ModRefResult | getModRefInfo (ImmutableCallSite CS, const Value *P, uint64_t Size) |
getModRefInfo (for call sites) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const CallInst *C, const Location &Loc) |
ModRefResult | getModRefInfo (const CallInst *C, const Value *P, uint64_t Size) |
getModRefInfo (for calls) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const InvokeInst *I, const Location &Loc) |
ModRefResult | getModRefInfo (const InvokeInst *I, const Value *P, uint64_t Size) |
getModRefInfo (for invokes) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const LoadInst *L, const Location &Loc) |
ModRefResult | getModRefInfo (const LoadInst *L, const Value *P, uint64_t Size) |
getModRefInfo (for loads) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const StoreInst *S, const Location &Loc) |
ModRefResult | getModRefInfo (const StoreInst *S, const Value *P, uint64_t Size) |
getModRefInfo (for stores) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const FenceInst *S, const Location &Loc) |
ModRefResult | getModRefInfo (const FenceInst *S, const Value *P, uint64_t Size) |
getModRefInfo (for fences) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const AtomicCmpXchgInst *CX, const Location &Loc) |
ModRefResult | getModRefInfo (const AtomicCmpXchgInst *CX, const Value *P, unsigned Size) |
getModRefInfo (for cmpxchges) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const AtomicRMWInst *RMW, const Location &Loc) |
ModRefResult | getModRefInfo (const AtomicRMWInst *RMW, const Value *P, unsigned Size) |
getModRefInfo (for atomicrmws) - A convenience wrapper. More... | |
ModRefResult | getModRefInfo (const VAArgInst *I, const Location &Loc) |
ModRefResult | getModRefInfo (const VAArgInst *I, const Value *P, uint64_t Size) |
getModRefInfo (for va_args) - A convenience wrapper. More... | |
virtual ModRefResult | getModRefInfo (ImmutableCallSite CS1, ImmutableCallSite CS2) |
ModRefResult | callCapturesBefore (const Instruction *I, const AliasAnalysis::Location &MemLoc, DominatorTree *DT) |
ModRefResult | callCapturesBefore (const Instruction *I, const Value *P, uint64_t Size, DominatorTree *DT) |
callCapturesBefore - A convenience wrapper. More... | |
bool | canBasicBlockModify (const BasicBlock &BB, const Location &Loc) |
bool | canBasicBlockModify (const BasicBlock &BB, const Value *P, uint64_t Size) |
canBasicBlockModify - A convenience wrapper. More... | |
bool | canInstructionRangeModify (const Instruction &I1, const Instruction &I2, const Location &Loc) |
bool | canInstructionRangeModify (const Instruction &I1, const Instruction &I2, const Value *Ptr, uint64_t Size) |
canInstructionRangeModify - A convenience wrapper. More... | |
virtual void | deleteValue (Value *V) |
virtual void | copyValue (Value *From, Value *To) |
virtual void | addEscapingUse (Use &U) |
void | replaceWithNewValue (Value *Old, Value *New) |
Static Public Member Functions | |
static Location | getLocationForSource (const MemTransferInst *MTI) |
static Location | getLocationForDest (const MemIntrinsic *MI) |
static bool | onlyReadsMemory (ModRefBehavior MRB) |
static bool | onlyAccessesArgPointees (ModRefBehavior MRB) |
static bool | doesAccessArgPointees (ModRefBehavior MRB) |
Static Public Attributes | |
static char | ID = 0 |
static uint64_t const | UnknownSize = ~UINT64_C(0) |
Protected Member Functions | |
void | InitializeAliasAnalysis (Pass *P) |
virtual void | getAnalysisUsage (AnalysisUsage &AU) const |
Protected Attributes | |
const DataLayout * | TD |
const TargetLibraryInfo * | TLI |
Definition at line 56 of file AliasAnalysis.h.
anonymous enum |
These values define additional bits used to define the ModRefBehavior values.
Enumerator | |
---|---|
Nowhere | |
ArgumentPointees | |
Anywhere |
Definition at line 235 of file AliasAnalysis.h.
Alias analysis result - Either we know for sure that it does not alias, we know for sure it must alias, or we don't know anything: The two pointers might alias. This enum is designed so you can do things like: if (AA.alias(P1, P2)) { ... } to check to see if two pointers might alias.
See docs/AliasAnalysis.html for more information on the specific meanings of these values.
Enumerator | |
---|---|
NoAlias |
No dependencies. |
MayAlias |
Anything goes. |
PartialAlias |
Pointers differ, but pointees overlap. |
MustAlias |
Pointers are equal. |
Definition at line 161 of file AliasAnalysis.h.
ModRefBehavior - Summary of how a function affects memory in the program. Loads from constant globals are not considered memory accesses for this interface. Also, functions may freely modify stack space local to their invocation without having to report it through these interfaces.
Definition at line 241 of file AliasAnalysis.h.
Simple mod/ref information...ModRefResult - Represent the result of a mod/ref query. Mod and Ref are bits which may be or'd together.
Enumerator | |
---|---|
NoModRef | |
Ref | |
Mod | |
ModRef |
Definition at line 231 of file AliasAnalysis.h.
|
inline |
Definition at line 78 of file AliasAnalysis.h.
|
virtual |
Definition at line 469 of file AliasAnalysis.cpp.
|
virtual |
addEscapingUse - This method should be used whenever an escaping use is added to a pointer value. Analysis implementations may either return conservative responses for that value in the future, or may recompute some or all internal state to continue providing precise responses.
Escaping uses are considered by anything except the following:
Definition at line 73 of file AliasAnalysis.cpp.
References addEscapingUse().
Referenced by addEscapingUse(), and ConstructSSAForLoadSet().
|
virtual |
alias - The main low level interface to the alias analysis implementation. Returns an AliasResult indicating whether the two pointers are aliased to each other. This is the interface that must be implemented by specific alias analysis implementations.
Definition at line 52 of file AliasAnalysis.cpp.
Referenced by alias(), llvm::AliasSet::aliasesPointer(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), isMustAlias(), isNoAlias(), llvm::AliasSet::mergeSetIn(), MIsNeedChainEdge(), and underlyingObjectsAlias().
|
inline |
|
inline |
alias - A convenience wrapper.
Definition at line 181 of file AliasAnalysis.h.
References alias(), and UnknownSize.
AliasAnalysis::ModRefResult AliasAnalysis::callCapturesBefore | ( | const Instruction * | I, |
const AliasAnalysis::Location & | MemLoc, | ||
DominatorTree * | DT | ||
) |
callCapturesBefore - Return information about whether a particular call site modifies or reads the specified memory location.
Definition at line 416 of file AliasAnalysis.cpp.
References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::doesNotAccessMemory(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::doesNotCapture(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::GetUnderlyingObject(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::isByValArgument(), llvm::isIdentifiedObject(), isNoAlias(), ModRef, NoModRef, llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::onlyReadsMemory(), llvm::PointerMayBeCaptured(), llvm::AliasAnalysis::Location::Ptr, Ref, and TD.
Referenced by callCapturesBefore(), and llvm::MemoryDependenceAnalysis::getPointerDependencyFrom().
|
inline |
callCapturesBefore - A convenience wrapper.
Definition at line 485 of file AliasAnalysis.h.
References callCapturesBefore().
bool AliasAnalysis::canBasicBlockModify | ( | const BasicBlock & | BB, |
const Location & | Loc | ||
) |
Higher level methods for querying mod/ref information.canBasicBlockModify - Return true if it is possible for execution of the specified basic block to modify the value pointed to by Ptr.
canBasicBlockModify - Return true if it is possible for execution of the specified basic block to modify the value pointed to by Ptr.
Definition at line 496 of file AliasAnalysis.cpp.
References llvm::BasicBlock::back(), canInstructionRangeModify(), and llvm::BasicBlock::front().
Referenced by canBasicBlockModify().
|
inline |
canBasicBlockModify - A convenience wrapper.
Definition at line 499 of file AliasAnalysis.h.
References canBasicBlockModify().
bool AliasAnalysis::canInstructionRangeModify | ( | const Instruction & | I1, |
const Instruction & | I2, | ||
const Location & | Loc | ||
) |
canInstructionRangeModify - Return true if it is possible for the execution of the specified instructions to modify the value pointed to by Ptr. The instructions to consider are all of the instructions in the range of [I1,I2] INCLUSIVE. I1 and I2 must be in the same basic block.
Definition at line 506 of file AliasAnalysis.cpp.
References getModRefInfo(), llvm::Instruction::getParent(), I, and Mod.
Referenced by canBasicBlockModify(), and canInstructionRangeModify().
|
inline |
canInstructionRangeModify - A convenience wrapper.
Definition at line 511 of file AliasAnalysis.h.
References canInstructionRangeModify().
copyValue - This method should be used whenever a preexisting value in the program is copied or cloned, introducing a new value. Note that analysis implementations should tolerate clients that use this method to introduce the same value multiple times: if the analysis already knows about a value, it should ignore the request.
Definition at line 68 of file AliasAnalysis.cpp.
References copyValue().
Referenced by ConstructSSAForLoadSet(), llvm::AliasSetTracker::copyValue(), copyValue(), replaceWithNewValue(), and UpdatePHINodes().
|
virtual |
Methods that clients should call when they transform the program to allow alias analyses to update their internal data structures. Note that these methods may be called on any instruction, regardless of whether or not they have pointer-analysis implications.deleteValue - This method should be called whenever an LLVM Value is deleted from the program, for example when an instruction is found to be redundant and is eliminated.
Definition at line 63 of file AliasAnalysis.cpp.
References deleteValue().
Referenced by llvm::AliasSetTracker::deleteValue(), deleteValue(), FindPHIToPartitionLoops(), llvm::FoldSingleEntryPHINodes(), llvm::MemoryDependenceAnalysis::removeInstruction(), and replaceWithNewValue().
|
inlinestatic |
doesAccessArgPointees - Return true if functions with the specified behavior are known to potentially read or write from objects pointed to be their pointer-typed arguments (with arbitrary offsets).
Definition at line 346 of file AliasAnalysis.h.
References ArgumentPointees, and ModRef.
Referenced by getModRefInfo().
|
inline |
doesNotAccessMemory - If the specified call is known to never read or write memory, return true. If the call only reads from known-constant memory, it is also legal to return true. Calls that unwind the stack are legal for this predicate.
Many optimizations (such as CSE and LICM) can be performed on such calls without worrying about aliasing properties, and many calls have this property (e.g. calls to 'sin' and 'cos').
This property corresponds to the GCC 'const' attribute.
Definition at line 295 of file AliasAnalysis.h.
References DoesNotAccessMemory, and getModRefBehavior().
doesNotAccessMemory - If the specified function is known to never read or write memory, return true. For use when the call site is not known.
Definition at line 302 of file AliasAnalysis.h.
References DoesNotAccessMemory, and getModRefBehavior().
|
protectedvirtual |
getAnalysisUsage - All alias analysis implementations should invoke this directly (using AliasAnalysis::getAnalysisUsage(AU)).
Reimplemented in llvm::LibCallAliasAnalysis.
Definition at line 482 of file AliasAnalysis.cpp.
References llvm::AnalysisUsage::addRequired().
Referenced by llvm::LibCallAliasAnalysis::getAnalysisUsage().
|
inline |
getDataLayout - Return a pointer to the current DataLayout object, or null if no DataLayout object is available.
Definition at line 89 of file AliasAnalysis.h.
References TD.
Referenced by getLocForWrite(), getPointerSize(), and isOverwrite().
AliasAnalysis::Location AliasAnalysis::getLocation | ( | const LoadInst * | LI | ) |
getLocation - Fill in Loc with information about the memory reference by the given instruction.
Definition at line 227 of file AliasAnalysis.cpp.
References llvm::Instruction::getMetadata(), llvm::LoadInst::getPointerOperand(), llvm::Value::getType(), getTypeStoreSize(), and llvm::LLVMContext::MD_tbaa.
Referenced by GetLocation(), getLocForWrite(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), and isSafeToMove().
AliasAnalysis::Location AliasAnalysis::getLocation | ( | const StoreInst * | SI | ) |
Definition at line 233 of file AliasAnalysis.cpp.
References llvm::Instruction::getMetadata(), llvm::StoreInst::getPointerOperand(), llvm::Value::getType(), getTypeStoreSize(), llvm::StoreInst::getValueOperand(), and llvm::LLVMContext::MD_tbaa.
AliasAnalysis::Location AliasAnalysis::getLocation | ( | const VAArgInst * | VI | ) |
Definition at line 239 of file AliasAnalysis.cpp.
References llvm::Instruction::getMetadata(), llvm::VAArgInst::getPointerOperand(), llvm::LLVMContext::MD_tbaa, and UnknownSize.
AliasAnalysis::Location AliasAnalysis::getLocation | ( | const AtomicCmpXchgInst * | CXI | ) |
Definition at line 246 of file AliasAnalysis.cpp.
References llvm::AtomicCmpXchgInst::getCompareOperand(), llvm::Instruction::getMetadata(), llvm::AtomicCmpXchgInst::getPointerOperand(), llvm::Value::getType(), getTypeStoreSize(), and llvm::LLVMContext::MD_tbaa.
AliasAnalysis::Location AliasAnalysis::getLocation | ( | const AtomicRMWInst * | RMWI | ) |
Definition at line 253 of file AliasAnalysis.cpp.
References llvm::Instruction::getMetadata(), llvm::AtomicRMWInst::getPointerOperand(), llvm::Value::getType(), getTypeStoreSize(), llvm::AtomicRMWInst::getValOperand(), and llvm::LLVMContext::MD_tbaa.
|
static |
Definition at line 273 of file AliasAnalysis.cpp.
References llvm::CallingConv::C, llvm::MemIntrinsic::getLength(), llvm::Instruction::getMetadata(), llvm::MemIntrinsic::getRawDest(), llvm::LLVMContext::MD_tbaa, and UnknownSize.
Referenced by getLocForWrite().
|
static |
Definition at line 260 of file AliasAnalysis.cpp.
References llvm::CallingConv::C, llvm::MemIntrinsic::getLength(), llvm::Instruction::getMetadata(), llvm::MemTransferInst::getRawSource(), llvm::LLVMContext::MD_tbaa, and UnknownSize.
Referenced by getLocForRead().
|
virtual |
getModRefBehavior - Return the behavior when calling the given call site.
Definition at line 199 of file AliasAnalysis.cpp.
References F(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), getModRefBehavior(), and UnknownModRefBehavior.
Referenced by llvm::objcarc::CanAlterRefCount(), doesNotAccessMemory(), getModRefBehavior(), getModRefInfo(), and onlyReadsMemory().
|
virtual |
getModRefBehavior - Return the behavior when calling the given function. For use when the call site is not known.
Definition at line 218 of file AliasAnalysis.cpp.
References getModRefBehavior().
|
inline |
getModRefInfo - Return information about whether or not an instruction may read or write the specified memory location. An instruction that doesn't read or write memory may be trivially LICM'd for example.
Definition at line 353 of file AliasAnalysis.h.
References llvm::Call, llvm::Instruction::getOpcode(), llvm::SPII::Load, NoModRef, and llvm::SPII::Store.
Referenced by llvm::AliasSet::aliasesPointer(), llvm::AliasSet::aliasesUnknownInst(), canInstructionRangeModify(), llvm::FindAvailableLoadedValue(), llvm::LibCallAliasAnalysis::getModRefInfo(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), isSafeToMove(), and mayLoopAccessLocation().
|
inline |
getModRefInfo - A convenience wrapper.
Definition at line 371 of file AliasAnalysis.h.
References getModRefInfo().
|
virtual |
getModRefInfo (for call sites) - Return information about whether a particular call site modifies or reads the specified memory location.
Reimplemented in llvm::LibCallAliasAnalysis.
Definition at line 80 of file AliasAnalysis.cpp.
References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), doesAccessArgPointees(), DoesNotAccessMemory, llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Instruction::getMetadata(), getModRefBehavior(), getModRefInfo(), llvm::Value::getType(), isNoAlias(), llvm::Type::isPointerTy(), llvm::LLVMContext::MD_tbaa, Mod, ModRef, NoModRef, onlyAccessesArgPointees(), onlyReadsMemory(), pointsToConstantMemory(), Ref, and UnknownSize.
|
inline |
getModRefInfo (for call sites) - A convenience wrapper.
Definition at line 382 of file AliasAnalysis.h.
References getModRefInfo().
|
inline |
getModRefInfo (for calls) - Return information about whether a particular call modifies or reads the specified memory location.
Definition at line 389 of file AliasAnalysis.h.
References getModRefInfo().
|
inline |
getModRefInfo (for calls) - A convenience wrapper.
Definition at line 394 of file AliasAnalysis.h.
References getModRefInfo().
|
inline |
getModRefInfo (for invokes) - Return information about whether a particular invoke modifies or reads the specified memory location.
Definition at line 400 of file AliasAnalysis.h.
References getModRefInfo().
|
inline |
getModRefInfo (for invokes) - A convenience wrapper.
Definition at line 406 of file AliasAnalysis.h.
References getModRefInfo().
AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo | ( | const LoadInst * | L, |
const Location & | Loc | ||
) |
getModRefInfo (for loads) - Return information about whether a particular load modifies or reads the specified memory location.
Definition at line 288 of file AliasAnalysis.cpp.
References alias(), getLocation(), llvm::LoadInst::isUnordered(), ModRef, NoModRef, and Ref.
|
inline |
getModRefInfo (for loads) - A convenience wrapper.
Definition at line 416 of file AliasAnalysis.h.
References getModRefInfo().
AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo | ( | const StoreInst * | S, |
const Location & | Loc | ||
) |
getModRefInfo (for stores) - Return information about whether a particular store modifies or reads the specified memory location.
Definition at line 303 of file AliasAnalysis.cpp.
References alias(), getLocation(), llvm::StoreInst::isUnordered(), Mod, ModRef, NoModRef, and pointsToConstantMemory().
|
inline |
getModRefInfo (for stores) - A convenience wrapper.
Definition at line 425 of file AliasAnalysis.h.
References getModRefInfo().
|
inline |
getModRefInfo (for fences) - Return information about whether a particular store modifies or reads the specified memory location.
Definition at line 431 of file AliasAnalysis.h.
References ModRef.
|
inline |
getModRefInfo (for fences) - A convenience wrapper.
Definition at line 438 of file AliasAnalysis.h.
References getModRefInfo().
AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo | ( | const AtomicCmpXchgInst * | CX, |
const Location & | Loc | ||
) |
getModRefInfo (for cmpxchges) - Return information about whether a particular cmpxchg modifies or reads the specified memory location.
Definition at line 339 of file AliasAnalysis.cpp.
References alias(), getLocation(), llvm::AtomicCmpXchgInst::getOrdering(), ModRef, llvm::Monotonic, and NoModRef.
|
inline |
getModRefInfo (for cmpxchges) - A convenience wrapper.
Definition at line 447 of file AliasAnalysis.h.
References getModRefInfo().
AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo | ( | const AtomicRMWInst * | RMW, |
const Location & | Loc | ||
) |
getModRefInfo (for atomicrmws) - Return information about whether a particular atomicrmw modifies or reads the specified memory location.
Definition at line 352 of file AliasAnalysis.cpp.
References alias(), getLocation(), llvm::AtomicRMWInst::getOrdering(), ModRef, llvm::Monotonic, and NoModRef.
|
inline |
getModRefInfo (for atomicrmws) - A convenience wrapper.
Definition at line 457 of file AliasAnalysis.h.
References getModRefInfo().
AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo | ( | const VAArgInst * | I, |
const Location & | Loc | ||
) |
getModRefInfo (for va_args) - Return information about whether a particular va_arg modifies or reads the specified memory location.
Definition at line 323 of file AliasAnalysis.cpp.
References alias(), getLocation(), ModRef, NoModRef, and pointsToConstantMemory().
|
inline |
getModRefInfo (for va_args) - A convenience wrapper.
Definition at line 467 of file AliasAnalysis.h.
References getModRefInfo().
|
virtual |
getModRefInfo - Return information about whether two call sites may refer to the same set of memory locations. See http://llvm.org/docs/AliasAnalysis.html#ModRefInfo for details.
Reimplemented in llvm::LibCallAliasAnalysis.
Definition at line 126 of file AliasAnalysis.cpp.
References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), doesAccessArgPointees(), DoesNotAccessMemory, llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Instruction::getMetadata(), getModRefBehavior(), getModRefInfo(), llvm::Value::getType(), I, llvm::Type::isPointerTy(), llvm::LLVMContext::MD_tbaa, ModRef, NoModRef, onlyAccessesArgPointees(), onlyReadsMemory(), Ref, and UnknownSize.
|
inline |
getTargetLibraryInfo - Return a pointer to the current TargetLibraryInfo object, or null if no TargetLibraryInfo object is available.
Definition at line 94 of file AliasAnalysis.h.
References TLI.
Referenced by GetLocation(), getLocForRead(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), and getPointerSize().
uint64_t AliasAnalysis::getTypeStoreSize | ( | Type * | Ty | ) |
getTypeStoreSize - Return the DataLayout store size for the given type, if known, or a conservative value otherwise.
Definition at line 489 of file AliasAnalysis.cpp.
References llvm::DataLayout::getTypeStoreSize(), TD, and UnknownSize.
Referenced by llvm::AliasSetTracker::add(), llvm::FindAvailableLoadedValue(), getLocation(), llvm::AliasSetTracker::remove(), and underlyingObjectsAlias().
|
protected |
InitializeAliasAnalysis - Subclasses must call this method to initialize the AliasAnalysis interface before any other methods are called. This is typically called by the run* methods of these subclasses. This may be called multiple times.
InitializeAliasAnalysis - Subclasses must call this method to initialize the AliasAnalysis interface before any other methods are called.
Definition at line 474 of file AliasAnalysis.cpp.
References llvm::Pass::getAnalysis(), llvm::Pass::getAnalysisIfAvailable(), TD, and TLI.
Referenced by llvm::LibCallAliasAnalysis::runOnFunction().
isMustAlias - A convenience wrapper.
Definition at line 203 of file AliasAnalysis.h.
References alias(), and MustAlias.
Referenced by llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), and isPossibleSelfRead().
isMustAlias - A convenience wrapper.
Definition at line 208 of file AliasAnalysis.h.
isNoAlias - A trivial helper function to check to see if the specified pointers are no-alias.
Definition at line 187 of file AliasAnalysis.h.
References alias(), and NoAlias.
Referenced by callCapturesBefore(), getModRefInfo(), isNoAlias(), and isPossibleSelfRead().
|
inline |
isNoAlias - A convenience wrapper.
Definition at line 192 of file AliasAnalysis.h.
References isNoAlias().
isNoAlias - A convenience wrapper.
Definition at line 198 of file AliasAnalysis.h.
References isNoAlias().
|
inlinestatic |
onlyAccessesArgPointees - Return true if functions with the specified behavior are known to read and write at most from objects pointed to by their pointer-typed arguments (with arbitrary offsets).
Definition at line 338 of file AliasAnalysis.h.
References Anywhere, and ArgumentPointees.
Referenced by llvm::objcarc::CanAlterRefCount(), and getModRefInfo().
|
inline |
onlyReadsMemory - If the specified call is known to only read from non-volatile memory (or not access memory at all), return true. Calls that unwind the stack are legal for this predicate.
This property allows many common optimizations to be performed in the absence of interfering store instructions, such as CSE of strlen calls.
This property corresponds to the GCC 'pure' attribute.
Definition at line 315 of file AliasAnalysis.h.
References getModRefBehavior().
Referenced by llvm::objcarc::CanAlterRefCount(), llvm::MemoryDependenceAnalysis::getDependency(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), and onlyReadsMemory().
onlyReadsMemory - If the specified function is known to only read from non-volatile memory (or not access memory at all), return true. For use when the call site is not known.
Definition at line 323 of file AliasAnalysis.h.
References getModRefBehavior(), and onlyReadsMemory().
|
inlinestatic |
onlyReadsMemory - Return true if functions with the specified behavior are known to only read from non-volatile memory (or not access memory at all).
Definition at line 330 of file AliasAnalysis.h.
References Mod.
pointsToConstantMemory - If the specified memory location is known to be constant, return true. If OrLocal is true and the specified memory location is known to be "local" (derived from an alloca), return true. Otherwise return false.
Definition at line 57 of file AliasAnalysis.cpp.
References pointsToConstantMemory().
Referenced by getMemCmpLoad(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), llvm::MachineInstr::isInvariantLoad(), llvm::objcarc::IsPotentialRetainableObjPtr(), and pointsToConstantMemory().
pointsToConstantMemory - A convenient wrapper.
Definition at line 220 of file AliasAnalysis.h.
References pointsToConstantMemory().
replaceWithNewValue - This method is the obvious combination of the two above, and it provided as a helper to simplify client code.
Definition at line 551 of file AliasAnalysis.h.
References copyValue(), and deleteValue().
|
static |
Definition at line 77 of file AliasAnalysis.h.
Referenced by llvm::LibCallAliasAnalysis::getAdjustedAnalysisPointer().
|
protected |
Definition at line 58 of file AliasAnalysis.h.
Referenced by callCapturesBefore(), getDataLayout(), getTypeStoreSize(), and InitializeAliasAnalysis().
|
protected |
Definition at line 59 of file AliasAnalysis.h.
Referenced by getTargetLibraryInfo(), and InitializeAliasAnalysis().
|
static |
UnknownSize - This is a special value which can be used with the size arguments in alias queries to indicate that the caller does not know the sizes of the potential memory references.
Definition at line 84 of file AliasAnalysis.h.
Referenced by llvm::AliasSetTracker::add(), alias(), getLocation(), getLocationForDest(), getLocationForSource(), getLocForWrite(), getModRefInfo(), getObjectSize(), getPointerSize(), getTypeStoreSize(), isObjectSize(), isObjectSmallerThan(), isOverwrite(), and llvm::AliasSetTracker::remove().