LLVM
8.0.1
|
Representation for a specific memory location. More...
#include "llvm/Analysis/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, LocationSize Size=LocationSize::unknown(), const AAMDNodes &AATags=AAMDNodes()) | |
MemoryLocation | getWithNewPtr (const Value *NewPtr) const |
MemoryLocation | getWithNewSize (LocationSize NewSize) const |
MemoryLocation | getWithoutAATags () const |
bool | operator== (const MemoryLocation &Other) const |
Public Attributes | |
const Value * | Ptr |
The address of the start of the location. More... | |
LocationSize | 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 175 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 180 of file MemoryLocation.h.
|
inlineexplicit |
Definition at line 244 of file MemoryLocation.h.
|
static |
Return a location with information about the memory reference by the given instruction.
Definition at line 35 of file MemoryLocation.cpp.
References llvm::Instruction::getAAMetadata(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::LoadInst::getPointerOperand(), llvm::Value::getType(), and llvm::LocationSize::precise().
Referenced by llvm::AliasSetTracker::add(), canMoveAboveCall(), llvm::canSinkOrHoistInst(), checkFunctionMemoryAccess(), llvm::MemorySSAUtil::defClobbersUseOrDef(), llvm::DependenceInfo::depends(), llvm::MemorySSAAnnotatedWriter::emitInstructionAnnot(), findSafeStoreForStoreStrongContraction(), GetLocation(), getLocation(), getLocForWrite(), llvm::AAResults::getModRefInfo(), llvm::MemoryDependenceResults::getNonLocalPointerDependency(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), llvm::DependenceInfo::getSplitIteration(), handleEndBlock(), isSafeToMove(), isSafeToPromoteArgument(), memoryIsNotModifiedBetween(), moveUp(), llvm::MemoryDepChecker::Dependence::print(), propagateMetadata(), and llvm::AAEvaluator::run().
|
static |
|
static |
Definition at line 56 of file MemoryLocation.cpp.
References llvm::Instruction::getAAMetadata(), llvm::VAArgInst::getPointerOperand(), and llvm::LocationSize::unknown().
|
static |
Definition at line 64 of file MemoryLocation.cpp.
References llvm::Instruction::getAAMetadata(), llvm::AtomicCmpXchgInst::getCompareOperand(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::AtomicCmpXchgInst::getPointerOperand(), llvm::Value::getType(), and llvm::LocationSize::precise().
|
static |
|
inlinestatic |
Definition at line 205 of file MemoryLocation.h.
References getOrNone().
|
static |
Return a location representing a particular argument of a call.
Definition at line 128 of file MemoryLocation.cpp.
References Arg, llvm::Intrinsic::arm_neon_vld1, llvm::Intrinsic::arm_neon_vst1, assert(), F(), llvm::Instruction::getAAMetadata(), llvm::CallBase::getArgOperand(), llvm::CallBase::getCalledFunction(), llvm::TargetLibraryInfo::getLibFunc(), llvm::DataLayout::getTypeStoreSize(), llvm::TargetLibraryInfo::has(), llvm::Intrinsic::invariant_end, llvm::Intrinsic::invariant_start, llvm::Intrinsic::lifetime_end, llvm::Intrinsic::lifetime_start, llvm::Intrinsic::memcpy, llvm::Intrinsic::memmove, llvm::Intrinsic::memset, llvm::LocationSize::precise(), and llvm::LocationSize::unknown().
Referenced by llvm::AliasSetTracker::add(), GetLocation(), and llvm::AAResults::getModRefInfo().
|
inlinestatic |
Definition at line 239 of file MemoryLocation.h.
|
static |
Return a location representing the destination of a memory set or transfer.
Definition at line 107 of file MemoryLocation.cpp.
Referenced by llvm::AliasSetTracker::add(), getLocForWrite(), llvm::BasicAAResult::getModRefInfo(), hasUndefContents(), and moveUp().
|
static |
Definition at line 111 of file MemoryLocation.cpp.
|
static |
Definition at line 115 of file MemoryLocation.cpp.
References C, llvm::Instruction::getAAMetadata(), llvm::MemIntrinsicBase< Derived >::getLength(), llvm::MemIntrinsicBase< Derived >::getRawDest(), llvm::LocationSize::precise(), Size, and llvm::LocationSize::unknown().
|
static |
Return a location representing the source of a memory transfer.
Definition at line 86 of file MemoryLocation.cpp.
Referenced by llvm::AliasSetTracker::add(), getLocForRead(), llvm::BasicAAResult::getModRefInfo(), hasUndefContents(), and moveUp().
|
static |
Definition at line 90 of file MemoryLocation.cpp.
|
static |
Definition at line 94 of file MemoryLocation.cpp.
References C, llvm::Instruction::getAAMetadata(), llvm::MemIntrinsicBase< Derived >::getLength(), llvm::MemTransferBase< BaseCL >::getRawSource(), llvm::LocationSize::precise(), Size, and llvm::LocationSize::unknown().
|
inlinestatic |
Definition at line 208 of file MemoryLocation.h.
References llvm::Instruction::getOpcode(), llvm::SPII::Load, MI, llvm::None, and llvm::SPII::Store.
Referenced by llvm::MemorySSA::checkClobberSanityAccess(), and get().
|
inline |
Definition at line 249 of file MemoryLocation.h.
References Ptr.
Referenced by SortNonLocalDepInfoCache().
|
inline |
Definition at line 255 of file MemoryLocation.h.
References Size.
Referenced by SortNonLocalDepInfoCache().
|
inline |
Definition at line 261 of file MemoryLocation.h.
References AATags.
Referenced by SortNonLocalDepInfoCache().
|
inline |
Definition at line 267 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 196 of file MemoryLocation.h.
Referenced by llvm::SCEVAAResult::alias(), llvm::ScopedNoAliasAAResult::alias(), llvm::TypeBasedAAResult::alias(), llvm::objcarc::ObjCARCAAResult::alias(), llvm::BasicAAResult::alias(), llvm::AliasSetTracker::getAliasSetFor(), llvm::DenseMapInfo< MemoryLocation >::getHashValue(), llvm::ScopedNoAliasAAResult::getModRefInfo(), llvm::TypeBasedAAResult::getModRefInfo(), getWithoutAATags(), operator==(), llvm::TypeBasedAAResult::pointsToConstantMemory(), llvm::objcarc::ObjCARCAAResult::pointsToConstantMemory(), llvm::MemoryDepChecker::Dependence::print(), llvm::RuntimePointerChecking::print(), SortNonLocalDepInfoCache(), and underlyingObjectsAlias().
The address of the start of the location.
Definition at line 183 of file MemoryLocation.h.
Referenced by llvm::SCEVAAResult::alias(), llvm::AMDGPUAAResult::alias(), llvm::objcarc::ObjCARCAAResult::alias(), llvm::CFLAndersAAResult::alias(), llvm::CFLSteensAAResult::alias(), llvm::BasicAAResult::alias(), llvm::GlobalsAAResult::alias(), llvm::AAResults::callCapturesBefore(), eliminateDeadStores(), findSafeStoreForStoreStrongContraction(), llvm::AliasSetTracker::getAliasSetFor(), llvm::MemoryDependenceResults::getDependency(), llvm::DenseMapInfo< MemoryLocation >::getHashValue(), GetLocation(), llvm::BasicAAResult::getModRefInfo(), llvm::GlobalsAAResult::getModRefInfo(), llvm::AAResults::getModRefInfo(), llvm::MemoryDependenceResults::getNonLocalPointerDependency(), llvm::slpvectorizer::BoUpSLP::getORE(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), getStoredPointerOperand(), getWithNewPtr(), isOverwrite(), isPossibleSelfRead(), operator==(), pointerInvalidatedByLoop(), llvm::AMDGPUAAResult::pointsToConstantMemory(), llvm::objcarc::ObjCARCAAResult::pointsToConstantMemory(), llvm::BasicAAResult::pointsToConstantMemory(), llvm::RuntimePointerChecking::print(), llvm::CFLAndersAAResult::query(), llvm::CFLSteensAAResult::query(), removeAccessedObjects(), removePartiallyOverlappedStores(), and underlyingObjectsAlias().
LocationSize 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 192 of file MemoryLocation.h.
Referenced by llvm::SCEVAAResult::alias(), llvm::objcarc::ObjCARCAAResult::alias(), llvm::BasicAAResult::alias(), eliminateDeadStores(), llvm::AliasSetTracker::getAliasSetFor(), llvm::DenseMapInfo< MemoryLocation >::getHashValue(), getWithNewSize(), isOverwrite(), operator==(), llvm::objcarc::ObjCARCAAResult::pointsToConstantMemory(), llvm::CFLAndersAAResult::query(), removePartiallyOverlappedStores(), and SortNonLocalDepInfoCache().