LLVM  4.0.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::MemoryLocation Class Reference

Representation for a specific memory location. More...

#include <MemoryLocation.h>

Collaboration diagram for llvm::MemoryLocation:
[legend]

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 ValuePtr
 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...
 

Detailed Description

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.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

llvm::MemoryLocation::MemoryLocation ( const Value Ptr = nullptr,
uint64_t  Size = UnknownSize,
const AAMDNodes AATags = AAMDNodes() 
)
inlineexplicit

Definition at line 95 of file MemoryLocation.h.

Referenced by get(), getForArgument(), getForDest(), and getForSource().

Member Function Documentation

MemoryLocation MemoryLocation::get ( const LoadInst LI)
static
MemoryLocation MemoryLocation::get ( const StoreInst SI)
static
MemoryLocation MemoryLocation::get ( const VAArgInst VI)
static
MemoryLocation MemoryLocation::get ( const AtomicCmpXchgInst CXI)
static
MemoryLocation MemoryLocation::get ( const AtomicRMWInst RMWI)
static
static MemoryLocation llvm::MemoryLocation::get ( const Instruction Inst)
inlinestatic

Definition at line 70 of file MemoryLocation.h.

References I, and llvm_unreachable.

MemoryLocation MemoryLocation::getForArgument ( ImmutableCallSite  CS,
unsigned  ArgIdx,
const TargetLibraryInfo TLI 
)
static
MemoryLocation MemoryLocation::getForDest ( const MemIntrinsic MI)
static

Return a location representing the destination of a memory set or transfer.

Definition at line 80 of file MemoryLocation.cpp.

References AATags, C, llvm::Instruction::getAAMetadata(), llvm::MemIntrinsic::getLength(), llvm::MemIntrinsic::getRawDest(), MemoryLocation(), Size, and UnknownSize.

Referenced by getLocForWrite(), and llvm::BasicAAResult::getModRefInfo().

MemoryLocation MemoryLocation::getForSource ( const MemTransferInst MTI)
static
MemoryLocation llvm::MemoryLocation::getWithNewPtr ( const Value NewPtr) const
inline

Definition at line 100 of file MemoryLocation.h.

References Ptr.

MemoryLocation llvm::MemoryLocation::getWithNewSize ( uint64_t  NewSize) const
inline

Definition at line 106 of file MemoryLocation.h.

References Size.

MemoryLocation llvm::MemoryLocation::getWithoutAATags ( ) const
inline

Definition at line 112 of file MemoryLocation.h.

References AATags.

bool llvm::MemoryLocation::operator== ( const MemoryLocation Other) const
inline

Definition at line 118 of file MemoryLocation.h.

References AATags, Ptr, and Size.

Member Data Documentation

AAMDNodes llvm::MemoryLocation::AATags
const Value* llvm::MemoryLocation::Ptr
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 llvm::SCEVAAResult::alias(), llvm::objcarc::ObjCARCAAResult::alias(), llvm::CFLAndersAAResult::alias(), llvm::BasicAAResult::alias(), llvm::CFLSteensAAResult::alias(), eliminateDeadStores(), getForDest(), getForSource(), llvm::DenseMapInfo< MemoryLocation >::getHashValue(), getWithNewSize(), isOverwrite(), operator==(), llvm::objcarc::ObjCARCAAResult::pointsToConstantMemory(), llvm::CFLAndersAAResult::query(), and removePartiallyOverlappedStores().


The documentation for this class was generated from the following files: