LLVM  3.7.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
llvm::AliasAnalysis Class Reference

#include <AliasAnalysis.h>

Inheritance diagram for llvm::AliasAnalysis:
[legend]
Collaboration diagram for llvm::AliasAnalysis:
[legend]

Public Types

enum  ModRefResult { NoModRef = 0, Ref = 1, Mod = 2, ModRef = 3 }
 Simple mod/ref information... More...
 
enum  { Nowhere = 0, ArgumentPointees = 4, Anywhere = 8 | ArgumentPointees }
 These values define additional bits used to define the ModRefBehavior values. More...
 
enum  ModRefBehavior {
  DoesNotAccessMemory = Nowhere | NoModRef, OnlyReadsArgumentPointees = ArgumentPointees | Ref, OnlyAccessesArgumentPointees = ArgumentPointees | ModRef, OnlyReadsMemory = Anywhere | Ref,
  UnknownModRefBehavior = Anywhere | ModRef
}
 ModRefBehavior - Summary of how a function affects memory in the program. More...
 

Public Member Functions

 AliasAnalysis ()
 
virtual ~AliasAnalysis ()
 
const TargetLibraryInfogetTargetLibraryInfo () const
 getTargetLibraryInfo - Return a pointer to the current TargetLibraryInfo object, or null if no TargetLibraryInfo object is available. More...
 
uint64_t getTypeStoreSize (Type *Ty)
 getTypeStoreSize - Return the DataLayout store size for the given type, if known, or a conservative value otherwise. More...
 
virtual AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 Alias Queries... More...
 
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 MemoryLocation &LocA, const MemoryLocation &LocB)
 isNoAlias - A trivial helper function to check to see if the specified pointers are no-alias. More...
 
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 MemoryLocation &LocA, const MemoryLocation &LocB)
 isMustAlias - A convenience wrapper. More...
 
bool isMustAlias (const Value *V1, const Value *V2)
 isMustAlias - A convenience wrapper. More...
 
virtual bool pointsToConstantMemory (const MemoryLocation &Loc, bool OrLocal=false)
 pointsToConstantMemory - If the specified memory location is known to be constant, return true. More...
 
bool pointsToConstantMemory (const Value *P, bool OrLocal=false)
 pointsToConstantMemory - A convenient wrapper. More...
 
virtual ModRefResult getArgModRefInfo (ImmutableCallSite CS, unsigned ArgIdx)
 Get the ModRef info associated with a pointer argument of a callsite. More...
 
virtual ModRefBehavior getModRefBehavior (ImmutableCallSite CS)
 getModRefBehavior - Return the behavior when calling the given call site. More...
 
virtual ModRefBehavior getModRefBehavior (const Function *F)
 getModRefBehavior - Return the behavior when calling the given function. More...
 
bool doesNotAccessMemory (ImmutableCallSite CS)
 doesNotAccessMemory - If the specified call is known to never read or write memory, return true. More...
 
bool doesNotAccessMemory (const Function *F)
 doesNotAccessMemory - If the specified function is known to never read or write memory, return true. More...
 
bool onlyReadsMemory (ImmutableCallSite CS)
 onlyReadsMemory - If the specified call is known to only read from non-volatile memory (or not access memory at all), return true. More...
 
bool onlyReadsMemory (const Function *F)
 onlyReadsMemory - If the specified function is known to only read from non-volatile memory (or not access memory at all), return true. More...
 
ModRefResult getModRefInfo (const Instruction *I)
 getModRefInfo - Return information about whether or not an instruction may read or write memory (without regard to a specific location) More...
 
ModRefResult getModRefInfo (const Instruction *I, const MemoryLocation &Loc)
 getModRefInfo - Return information about whether or not an instruction may read or write the specified memory location. More...
 
ModRefResult getModRefInfo (const Instruction *I, const Value *P, uint64_t Size)
 getModRefInfo - A convenience wrapper. More...
 
virtual ModRefResult getModRefInfo (ImmutableCallSite CS, const MemoryLocation &Loc)
 getModRefInfo (for call sites) - Return information about whether a particular call site modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (ImmutableCallSite CS, const Value *P, uint64_t Size)
 getModRefInfo (for call sites) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const CallInst *C, const MemoryLocation &Loc)
 getModRefInfo (for calls) - Return information about whether a particular call modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const CallInst *C, const Value *P, uint64_t Size)
 getModRefInfo (for calls) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const InvokeInst *I, const MemoryLocation &Loc)
 getModRefInfo (for invokes) - Return information about whether a particular invoke modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const InvokeInst *I, const Value *P, uint64_t Size)
 getModRefInfo (for invokes) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const LoadInst *L, const MemoryLocation &Loc)
 getModRefInfo (for loads) - Return information about whether a particular load modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const LoadInst *L, const Value *P, uint64_t Size)
 getModRefInfo (for loads) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const StoreInst *S, const MemoryLocation &Loc)
 getModRefInfo (for stores) - Return information about whether a particular store modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const StoreInst *S, const Value *P, uint64_t Size)
 getModRefInfo (for stores) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const FenceInst *S, const MemoryLocation &Loc)
 getModRefInfo (for fences) - Return information about whether a particular store modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const FenceInst *S, const Value *P, uint64_t Size)
 getModRefInfo (for fences) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const AtomicCmpXchgInst *CX, const MemoryLocation &Loc)
 getModRefInfo (for cmpxchges) - Return information about whether a particular cmpxchg modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const AtomicCmpXchgInst *CX, const Value *P, unsigned Size)
 getModRefInfo (for cmpxchges) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const AtomicRMWInst *RMW, const MemoryLocation &Loc)
 getModRefInfo (for atomicrmws) - Return information about whether a particular atomicrmw modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const AtomicRMWInst *RMW, const Value *P, unsigned Size)
 getModRefInfo (for atomicrmws) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const VAArgInst *I, const MemoryLocation &Loc)
 getModRefInfo (for va_args) - Return information about whether a particular va_arg modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const VAArgInst *I, const Value *P, uint64_t Size)
 getModRefInfo (for va_args) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (Instruction *I, ImmutableCallSite Call)
 getModRefInfo - Return information about whether a call and an instruction may refer to the same memory locations. More...
 
virtual ModRefResult getModRefInfo (ImmutableCallSite CS1, ImmutableCallSite CS2)
 getModRefInfo - Return information about whether two call sites may refer to the same set of memory locations. More...
 
ModRefResult callCapturesBefore (const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
 callCapturesBefore - Return information about whether a particular call site modifies or reads the specified memory location. More...
 
ModRefResult callCapturesBefore (const Instruction *I, const Value *P, uint64_t Size, DominatorTree *DT)
 callCapturesBefore - A convenience wrapper. More...
 
bool canBasicBlockModify (const BasicBlock &BB, const MemoryLocation &Loc)
 Higher level methods for querying mod/ref information. More...
 
bool canBasicBlockModify (const BasicBlock &BB, const Value *P, uint64_t Size)
 canBasicBlockModify - A convenience wrapper. More...
 
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 instructions to mod(according to the mode) the location Loc. More...
 
bool canInstructionRangeModRef (const Instruction &I1, const Instruction &I2, const Value *Ptr, uint64_t Size, const ModRefResult Mode)
 canInstructionRangeModRef - A convenience wrapper. More...
 
virtual void deleteValue (Value *V)
 Methods that clients should call when they transform the program to allow alias analyses to update their internal data structures. More...
 
virtual void addEscapingUse (Use &U)
 addEscapingUse - This method should be used whenever an escaping use is added to a pointer value. More...
 
void replaceWithNewValue (Value *Old, Value *New)
 replaceWithNewValue - This method is the obvious combination of the two above, and it provided as a helper to simplify client code. More...
 

Static Public Member Functions

static bool onlyReadsMemory (ModRefBehavior MRB)
 onlyReadsMemory - Return true if functions with the specified behavior are known to only read from non-volatile memory (or not access memory at all). More...
 
static bool onlyAccessesArgPointees (ModRefBehavior MRB)
 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). More...
 
static bool doesAccessArgPointees (ModRefBehavior MRB)
 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). More...
 

Static Public Attributes

static char ID = 0
 

Protected Member Functions

void InitializeAliasAnalysis (Pass *P, const DataLayout *DL)
 InitializeAliasAnalysis - Subclasses must call this method to initialize the AliasAnalysis interface before any other methods are called. More...
 
virtual void getAnalysisUsage (AnalysisUsage &AU) const
 getAnalysisUsage - All alias analysis implementations should invoke this directly (using AliasAnalysis::getAnalysisUsage(AU)). More...
 

Protected Attributes

const DataLayoutDL
 
const TargetLibraryInfoTLI
 

Detailed Description

Definition at line 87 of file AliasAnalysis.h.

Member Enumeration Documentation

anonymous enum

These values define additional bits used to define the ModRefBehavior values.

Enumerator
Nowhere 
ArgumentPointees 
Anywhere 

Definition at line 195 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.

Enumerator
DoesNotAccessMemory 

DoesNotAccessMemory - This function does not perform any non-local loads or stores to memory.

This property corresponds to the GCC 'const' attribute. This property corresponds to the LLVM IR 'readnone' attribute. This property corresponds to the IntrNoMem LLVM intrinsic flag.

OnlyReadsArgumentPointees 

OnlyReadsArgumentPointees - The only memory references in this function (if it has any) are non-volatile loads from objects pointed to by its pointer-typed arguments, with arbitrary offsets.

This property corresponds to the LLVM IR 'argmemonly' attribute combined with 'readonly' attribute. This property corresponds to the IntrReadArgMem LLVM intrinsic flag.

OnlyAccessesArgumentPointees 

OnlyAccessesArgumentPointees - The only memory references in this function (if it has any) are non-volatile loads and stores from objects pointed to by its pointer-typed arguments, with arbitrary offsets.

This property corresponds to the LLVM IR 'argmemonly' attribute. This property corresponds to the IntrReadWriteArgMem LLVM intrinsic flag.

OnlyReadsMemory 

OnlyReadsMemory - This function does not perform any non-local stores or volatile loads, but may read from any memory location.

This property corresponds to the GCC 'pure' attribute. This property corresponds to the LLVM IR 'readonly' attribute. This property corresponds to the IntrReadMem LLVM intrinsic flag.

UnknownModRefBehavior 

UnknownModRefBehavior - This indicates that the function could not be classified into one of the behaviors above.

Definition at line 201 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 191 of file AliasAnalysis.h.

Constructor & Destructor Documentation

llvm::AliasAnalysis::AliasAnalysis ( )
inline

Definition at line 109 of file AliasAnalysis.h.

AliasAnalysis::~AliasAnalysis ( )
virtual

Definition at line 405 of file AliasAnalysis.cpp.

Member Function Documentation

void AliasAnalysis::addEscapingUse ( Use U)
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:

  • GEPs or bitcasts of the pointer
  • Loads through the pointer
  • Stores through (but not of) the pointer

Definition at line 74 of file AliasAnalysis.cpp.

References addEscapingUse().

Referenced by addEscapingUse(), and ConstructSSAForLoadSet().

AliasResult AliasAnalysis::alias ( const MemoryLocation LocA,
const MemoryLocation LocB 
)
virtual

Alias Queries...

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 51 of file AliasAnalysis.cpp.

Referenced by alias(), llvm::AliasSet::aliasesPointer(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), isMustAlias(), isNoAlias(), llvm::AliasSet::mergeSetIn(), MIsNeedChainEdge(), and underlyingObjectsAlias().

AliasResult llvm::AliasAnalysis::alias ( const Value V1,
uint64_t  V1Size,
const Value V2,
uint64_t  V2Size 
)
inline

alias - A convenience wrapper.

Definition at line 134 of file AliasAnalysis.h.

References alias().

AliasResult llvm::AliasAnalysis::alias ( const Value V1,
const Value V2 
)
inline

alias - A convenience wrapper.

Definition at line 140 of file AliasAnalysis.h.

References alias(), and llvm::MemoryLocation::UnknownSize.

AliasAnalysis::ModRefResult AliasAnalysis::callCapturesBefore ( const Instruction I,
const MemoryLocation MemLoc,
DominatorTree DT 
)
ModRefResult llvm::AliasAnalysis::callCapturesBefore ( const Instruction I,
const Value P,
uint64_t  Size,
DominatorTree DT 
)
inline

callCapturesBefore - A convenience wrapper.

Definition at line 477 of file AliasAnalysis.h.

References callCapturesBefore().

bool AliasAnalysis::canBasicBlockModify ( const BasicBlock BB,
const MemoryLocation 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 location Loc.

Definition at line 433 of file AliasAnalysis.cpp.

References llvm::BasicBlock::back(), canInstructionRangeModRef(), llvm::BasicBlock::front(), and Mod.

Referenced by canBasicBlockModify().

bool llvm::AliasAnalysis::canBasicBlockModify ( const BasicBlock BB,
const Value P,
uint64_t  Size 
)
inline

canBasicBlockModify - A convenience wrapper.

Definition at line 491 of file AliasAnalysis.h.

References canBasicBlockModify().

bool AliasAnalysis::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 instructions to mod(according to the mode) the location Loc.

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 443 of file AliasAnalysis.cpp.

References getModRefInfo(), llvm::Instruction::getParent(), and I.

Referenced by canBasicBlockModify(), and canInstructionRangeModRef().

bool llvm::AliasAnalysis::canInstructionRangeModRef ( const Instruction I1,
const Instruction I2,
const Value Ptr,
uint64_t  Size,
const ModRefResult  Mode 
)
inline

canInstructionRangeModRef - A convenience wrapper.

Definition at line 505 of file AliasAnalysis.h.

References canInstructionRangeModRef().

void AliasAnalysis::deleteValue ( Value V)
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 69 of file AliasAnalysis.cpp.

References deleteValue().

Referenced by llvm::AliasSetTracker::deleteValue(), deleteValue(), findPHIToPartitionLoops(), llvm::FoldSingleEntryPHINodes(), insertUniqueBackedgeBlock(), llvm::MemoryDependenceAnalysis::removeInstruction(), replaceWithNewValue(), and simplifyOneLoop().

static bool llvm::AliasAnalysis::doesAccessArgPointees ( ModRefBehavior  MRB)
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 316 of file AliasAnalysis.h.

References ArgumentPointees, and ModRef.

Referenced by getModRefInfo().

bool llvm::AliasAnalysis::doesNotAccessMemory ( ImmutableCallSite  CS)
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 265 of file AliasAnalysis.h.

References DoesNotAccessMemory, and getModRefBehavior().

bool llvm::AliasAnalysis::doesNotAccessMemory ( const Function F)
inline

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 272 of file AliasAnalysis.h.

References DoesNotAccessMemory, and getModRefBehavior().

void AliasAnalysis::getAnalysisUsage ( AnalysisUsage AU) const
protectedvirtual

getAnalysisUsage - All alias analysis implementations should invoke this directly (using AliasAnalysis::getAnalysisUsage(AU)).

Reimplemented in llvm::LibCallAliasAnalysis.

Definition at line 419 of file AliasAnalysis.cpp.

References llvm::AnalysisUsage::addRequired().

Referenced by llvm::LibCallAliasAnalysis::getAnalysisUsage().

AliasAnalysis::ModRefResult AliasAnalysis::getArgModRefInfo ( ImmutableCallSite  CS,
unsigned  ArgIdx 
)
virtual

Get the ModRef info associated with a pointer argument of a callsite.

The result's bits are set to indicate the allowed aliasing ModRef kinds. Note that these bits do not necessarily account for the overall behavior of the function, but rather only provide additional per-argument information.

Definition at line 64 of file AliasAnalysis.cpp.

References getArgModRefInfo().

Referenced by getArgModRefInfo(), and getModRefInfo().

AliasAnalysis::ModRefBehavior AliasAnalysis::getModRefBehavior ( ImmutableCallSite  CS)
virtual
AliasAnalysis::ModRefBehavior AliasAnalysis::getModRefBehavior ( const Function F)
virtual

getModRefBehavior - Return the behavior when calling the given function.

For use when the call site is not known.

Definition at line 255 of file AliasAnalysis.cpp.

References getModRefBehavior().

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const Instruction I)
inline
ModRefResult llvm::AliasAnalysis::getModRefInfo ( const Instruction I,
const MemoryLocation Loc 
)
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 341 of file AliasAnalysis.h.

References llvm::Call, getModRefInfo(), llvm::Instruction::getOpcode(), llvm::SPII::Load, NoModRef, and llvm::SPII::Store.

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const Instruction I,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo - A convenience wrapper.

Definition at line 358 of file AliasAnalysis.h.

References getModRefInfo().

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( ImmutableCallSite  CS,
const MemoryLocation Loc 
)
virtual
ModRefResult llvm::AliasAnalysis::getModRefInfo ( ImmutableCallSite  CS,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo (for call sites) - A convenience wrapper.

Definition at line 369 of file AliasAnalysis.h.

References getModRefInfo().

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const CallInst C,
const MemoryLocation Loc 
)
inline

getModRefInfo (for calls) - Return information about whether a particular call modifies or reads the specified memory location.

Definition at line 376 of file AliasAnalysis.h.

References getModRefInfo().

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const CallInst C,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo (for calls) - A convenience wrapper.

Definition at line 381 of file AliasAnalysis.h.

References getModRefInfo().

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const InvokeInst I,
const MemoryLocation Loc 
)
inline

getModRefInfo (for invokes) - Return information about whether a particular invoke modifies or reads the specified memory location.

Definition at line 387 of file AliasAnalysis.h.

References getModRefInfo().

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const InvokeInst I,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo (for invokes) - A convenience wrapper.

Definition at line 392 of file AliasAnalysis.h.

References getModRefInfo().

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( const LoadInst L,
const MemoryLocation Loc 
)

getModRefInfo (for loads) - Return information about whether a particular load modifies or reads the specified memory location.

Definition at line 265 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::LoadInst::isUnordered(), ModRef, NoModRef, llvm::MemoryLocation::Ptr, and Ref.

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const LoadInst L,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo (for loads) - A convenience wrapper.

Definition at line 402 of file AliasAnalysis.h.

References getModRefInfo().

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( const StoreInst S,
const MemoryLocation Loc 
)

getModRefInfo (for stores) - Return information about whether a particular store modifies or reads the specified memory location.

Definition at line 280 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::StoreInst::isUnordered(), Mod, ModRef, NoModRef, pointsToConstantMemory(), and llvm::MemoryLocation::Ptr.

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const StoreInst S,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo (for stores) - A convenience wrapper.

Definition at line 411 of file AliasAnalysis.h.

References getModRefInfo().

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const FenceInst S,
const MemoryLocation Loc 
)
inline

getModRefInfo (for fences) - Return information about whether a particular store modifies or reads the specified memory location.

Definition at line 417 of file AliasAnalysis.h.

References ModRef.

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const FenceInst S,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo (for fences) - A convenience wrapper.

Definition at line 424 of file AliasAnalysis.h.

References getModRefInfo().

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( const AtomicCmpXchgInst CX,
const MemoryLocation Loc 
)

getModRefInfo (for cmpxchges) - Return information about whether a particular cmpxchg modifies or reads the specified memory location.

Definition at line 322 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::AtomicCmpXchgInst::getSuccessOrdering(), ModRef, llvm::Monotonic, NoModRef, and llvm::MemoryLocation::Ptr.

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const AtomicCmpXchgInst CX,
const Value P,
unsigned  Size 
)
inline

getModRefInfo (for cmpxchges) - A convenience wrapper.

Definition at line 434 of file AliasAnalysis.h.

References getModRefInfo().

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( const AtomicRMWInst RMW,
const MemoryLocation Loc 
)

getModRefInfo (for atomicrmws) - Return information about whether a particular atomicrmw modifies or reads the specified memory location.

Definition at line 336 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::AtomicRMWInst::getOrdering(), ModRef, llvm::Monotonic, NoModRef, and llvm::MemoryLocation::Ptr.

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const AtomicRMWInst RMW,
const Value P,
unsigned  Size 
)
inline

getModRefInfo (for atomicrmws) - A convenience wrapper.

Definition at line 445 of file AliasAnalysis.h.

References getModRefInfo().

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( const VAArgInst I,
const MemoryLocation Loc 
)

getModRefInfo (for va_args) - Return information about whether a particular va_arg modifies or reads the specified memory location.

Definition at line 303 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), ModRef, NoModRef, pointsToConstantMemory(), and llvm::MemoryLocation::Ptr.

ModRefResult llvm::AliasAnalysis::getModRefInfo ( const VAArgInst I,
const Value P,
uint64_t  Size 
)
inline

getModRefInfo (for va_args) - A convenience wrapper.

Definition at line 455 of file AliasAnalysis.h.

References getModRefInfo().

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( Instruction I,
ImmutableCallSite  Call 
)

getModRefInfo - Return information about whether a call and an instruction may refer to the same memory locations.

Definition at line 80 of file AliasAnalysis.cpp.

References llvm::CS, llvm::MemoryLocation::get(), getModRefInfo(), ModRef, and NoModRef.

AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo ( ImmutableCallSite  CS1,
ImmutableCallSite  CS2 
)
virtual
const TargetLibraryInfo* llvm::AliasAnalysis::getTargetLibraryInfo ( ) const
inline

getTargetLibraryInfo - Return a pointer to the current TargetLibraryInfo object, or null if no TargetLibraryInfo object is available.

Definition at line 115 of file AliasAnalysis.h.

References TLI.

Referenced by GetLocation(), getLocForRead(), and llvm::MemoryDependenceAnalysis::getPointerDependencyFrom().

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 426 of file AliasAnalysis.cpp.

References DL, llvm::DataLayout::getTypeStoreSize(), and llvm::MemoryLocation::UnknownSize.

Referenced by llvm::AliasSetTracker::add(), canSinkOrHoistInst(), llvm::AliasSetTracker::remove(), and underlyingObjectsAlias().

void AliasAnalysis::InitializeAliasAnalysis ( Pass P,
const DataLayout DL 
)
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.

Definition at line 410 of file AliasAnalysis.cpp.

References DL, llvm::Pass::getAnalysis(), llvm::Pass::getAnalysisIfAvailable(), and TLI.

Referenced by llvm::LibCallAliasAnalysis::runOnFunction().

bool llvm::AliasAnalysis::isMustAlias ( const MemoryLocation LocA,
const MemoryLocation LocB 
)
inline

isMustAlias - A convenience wrapper.

Definition at line 163 of file AliasAnalysis.h.

References alias(), and llvm::MustAlias.

Referenced by llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), and isPossibleSelfRead().

bool llvm::AliasAnalysis::isMustAlias ( const Value V1,
const Value V2 
)
inline

isMustAlias - A convenience wrapper.

Definition at line 168 of file AliasAnalysis.h.

References alias(), and llvm::MustAlias.

bool llvm::AliasAnalysis::isNoAlias ( const MemoryLocation LocA,
const MemoryLocation LocB 
)
inline

isNoAlias - A trivial helper function to check to see if the specified pointers are no-alias.

Definition at line 147 of file AliasAnalysis.h.

References alias(), and llvm::NoAlias.

Referenced by callCapturesBefore(), getModRefInfo(), isNoAlias(), and isPossibleSelfRead().

bool llvm::AliasAnalysis::isNoAlias ( const Value V1,
uint64_t  V1Size,
const Value V2,
uint64_t  V2Size 
)
inline

isNoAlias - A convenience wrapper.

Definition at line 152 of file AliasAnalysis.h.

References isNoAlias().

bool llvm::AliasAnalysis::isNoAlias ( const Value V1,
const Value V2 
)
inline

isNoAlias - A convenience wrapper.

Definition at line 158 of file AliasAnalysis.h.

References isNoAlias().

static bool llvm::AliasAnalysis::onlyAccessesArgPointees ( ModRefBehavior  MRB)
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 308 of file AliasAnalysis.h.

References Anywhere, and ArgumentPointees.

Referenced by llvm::objcarc::CanAlterRefCount(), and getModRefInfo().

bool llvm::AliasAnalysis::onlyReadsMemory ( ImmutableCallSite  CS)
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 285 of file AliasAnalysis.h.

References getModRefBehavior().

Referenced by llvm::objcarc::CanAlterRefCount(), canSinkOrHoistInst(), llvm::MemoryDependenceAnalysis::getDependency(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), and onlyReadsMemory().

bool llvm::AliasAnalysis::onlyReadsMemory ( const Function F)
inline

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 293 of file AliasAnalysis.h.

References getModRefBehavior(), and onlyReadsMemory().

static bool llvm::AliasAnalysis::onlyReadsMemory ( ModRefBehavior  MRB)
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 300 of file AliasAnalysis.h.

References Mod.

bool AliasAnalysis::pointsToConstantMemory ( const MemoryLocation Loc,
bool  OrLocal = false 
)
virtual

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 canSinkOrHoistInst(), getMemCmpLoad(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), llvm::MachineInstr::isInvariantLoad(), llvm::objcarc::IsPotentialRetainableObjPtr(), and pointsToConstantMemory().

bool llvm::AliasAnalysis::pointsToConstantMemory ( const Value P,
bool  OrLocal = false 
)
inline

pointsToConstantMemory - A convenient wrapper.

Definition at line 180 of file AliasAnalysis.h.

References pointsToConstantMemory().

void llvm::AliasAnalysis::replaceWithNewValue ( Value Old,
Value New 
)
inline

replaceWithNewValue - This method is the obvious combination of the two above, and it provided as a helper to simplify client code.

Definition at line 538 of file AliasAnalysis.h.

References deleteValue().

Member Data Documentation

const DataLayout* llvm::AliasAnalysis::DL
protected

Definition at line 89 of file AliasAnalysis.h.

Referenced by callCapturesBefore(), getTypeStoreSize(), and InitializeAliasAnalysis().

char AliasAnalysis::ID = 0
static
const TargetLibraryInfo* llvm::AliasAnalysis::TLI
protected

Definition at line 90 of file AliasAnalysis.h.

Referenced by getModRefInfo(), getTargetLibraryInfo(), and InitializeAliasAnalysis().


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