|
LLVM
3.7.0
|
Representation for a specific memory location. More...
#include <MemoryLocation.h>
Public Types | |
| enum | : uint64_t { UnknownSize = ~UINT64_C(0) } |
| 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. More... | |
Public Member Functions | |
| MemoryLocation (const Value *Ptr=nullptr, uint64_t Size=UnknownSize, const AAMDNodes &AATags=AAMDNodes()) | |
| MemoryLocation | getWithNewPtr (const Value *NewPtr) const |
| MemoryLocation | getWithNewSize (uint64_t NewSize) const |
| MemoryLocation | getWithoutAATags () const |
| bool | operator== (const MemoryLocation &Other) const |
Static Public Member Functions | |
| static MemoryLocation | get (const LoadInst *LI) |
| Return a location with information about the memory reference by the given instruction. More... | |
| static MemoryLocation | get (const StoreInst *SI) |
| static MemoryLocation | get (const VAArgInst *VI) |
| static MemoryLocation | get (const AtomicCmpXchgInst *CXI) |
| static MemoryLocation | get (const AtomicRMWInst *RMWI) |
| static MemoryLocation | get (const Instruction *Inst) |
| static MemoryLocation | getForSource (const MemTransferInst *MTI) |
| Return a location representing the source of a memory transfer. More... | |
| static MemoryLocation | getForDest (const MemIntrinsic *MI) |
| Return a location representing the destination of a memory set or transfer. More... | |
| static MemoryLocation | getForArgument (ImmutableCallSite CS, unsigned ArgIdx, const TargetLibraryInfo &TLI) |
| Return a location representing a particular argument of a call. More... | |
Public Attributes | |
| const Value * | Ptr |
| The address of the start of the location. More... | |
| uint64_t | Size |
| The maximum size of the location, in address-units, or UnknownSize if the size is not known. More... | |
| AAMDNodes | AATags |
| The metadata nodes which describes the aliasing of the location (each member is null if that kind of information is unavailable). More... | |
Representation for a specific memory location.
This abstraction can be used to represent a specific location in memory. The goal of the location is to represent enough information to describe abstract aliasing, modification, and reference behaviors of whatever value(s) are stored in memory at the particular location.
The primary user of this interface is LLVM's Alias Analysis, but other memory analyses such as MemoryDependence can use it as well.
Definition at line 40 of file MemoryLocation.h.
| anonymous enum : uint64_t |
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.
| Enumerator | |
|---|---|
| UnknownSize | |
Definition at line 45 of file MemoryLocation.h.
|
inlineexplicit |
Definition at line 95 of file MemoryLocation.h.
Referenced by get(), getForArgument(), getForDest(), and getForSource().
|
static |
Return a location with information about the memory reference by the given instruction.
Definition at line 21 of file MemoryLocation.cpp.
References AATags, llvm::DL, llvm::Instruction::getAAMetadata(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::LoadInst::getPointerOperand(), llvm::Value::getType(), and MemoryLocation().
Referenced by findSafeStoreForStoreStrongContraction(), GetLocation(), getLocForWrite(), llvm::AliasAnalysis::getModRefInfo(), llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), and isSafeToMove().
|
static |
Definition at line 30 of file MemoryLocation.cpp.
References AATags, llvm::DL, llvm::Instruction::getAAMetadata(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::StoreInst::getPointerOperand(), llvm::Value::getType(), llvm::StoreInst::getValueOperand(), and MemoryLocation().
|
static |
Definition at line 40 of file MemoryLocation.cpp.
References AATags, llvm::Instruction::getAAMetadata(), llvm::VAArgInst::getPointerOperand(), MemoryLocation(), and UnknownSize.
|
static |
Definition at line 47 of file MemoryLocation.cpp.
References AATags, llvm::DL, llvm::Instruction::getAAMetadata(), llvm::AtomicCmpXchgInst::getCompareOperand(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::AtomicCmpXchgInst::getPointerOperand(), llvm::Value::getType(), and MemoryLocation().
|
static |
Definition at line 57 of file MemoryLocation.cpp.
References AATags, llvm::DL, llvm::Instruction::getAAMetadata(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::AtomicRMWInst::getPointerOperand(), llvm::Value::getType(), llvm::AtomicRMWInst::getValOperand(), and MemoryLocation().
|
inlinestatic |
Definition at line 70 of file MemoryLocation.h.
References I, and llvm_unreachable.
|
static |
Return a location representing a particular argument of a call.
Definition at line 110 of file MemoryLocation.cpp.
References AATags, llvm::DL, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getArgument(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledFunction(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::DataLayout::getTypeStoreSize(), isMemsetPattern16(), MemoryLocation(), and UnknownSize.
Referenced by llvm::AliasAnalysis::getModRefInfo().
|
static |
Return a location representing the destination of a memory set or transfer.
Definition at line 80 of file MemoryLocation.cpp.
References AATags, llvm::C, llvm::Instruction::getAAMetadata(), llvm::MemIntrinsic::getLength(), llvm::MemIntrinsic::getRawDest(), MemoryLocation(), Size, and UnknownSize.
Referenced by getLocForWrite().
|
static |
Return a location representing the source of a memory transfer.
Definition at line 67 of file MemoryLocation.cpp.
References AATags, llvm::C, llvm::Instruction::getAAMetadata(), llvm::MemIntrinsic::getLength(), llvm::MemTransferInst::getRawSource(), MemoryLocation(), Size, and UnknownSize.
Referenced by getLocForRead().
|
inline |
Definition at line 100 of file MemoryLocation.h.
References Ptr.
|
inline |
Definition at line 106 of file MemoryLocation.h.
References Size.
|
inline |
Definition at line 112 of file MemoryLocation.h.
References AATags.
|
inline |
Definition at line 118 of file MemoryLocation.h.
| AAMDNodes llvm::MemoryLocation::AATags |
The metadata nodes which describes the aliasing of the location (each member is null if that kind of information is unavailable).
Definition at line 61 of file MemoryLocation.h.
Referenced by get(), getForArgument(), getForDest(), getForSource(), llvm::DenseMapInfo< MemoryLocation >::getHashValue(), getWithoutAATags(), and operator==().
The address of the start of the location.
Definition at line 48 of file MemoryLocation.h.
Referenced by llvm::AliasAnalysis::callCapturesBefore(), findSafeStoreForStoreStrongContraction(), llvm::MemoryDependenceAnalysis::getDependency(), llvm::DenseMapInfo< MemoryLocation >::getHashValue(), llvm::AliasAnalysis::getModRefInfo(), llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), getWithNewPtr(), isLoadLoadClobberIfExtendedToFullWidth(), isOverwrite(), isPossibleSelfRead(), and operator==().
| uint64_t llvm::MemoryLocation::Size |
The maximum size of the location, in address-units, or UnknownSize if the size is not known.
Note that an unknown size does not mean the pointer aliases the entire virtual address space, because there are restrictions on stepping out of one object and into another. See http://llvm.org/docs/LangRef.html#pointeraliasing
Definition at line 57 of file MemoryLocation.h.
Referenced by getForDest(), getForSource(), llvm::DenseMapInfo< MemoryLocation >::getHashValue(), getWithNewSize(), isLoadLoadClobberIfExtendedToFullWidth(), isOverwrite(), and operator==().
1.8.6