LLVM API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
llvm::AliasAnalysis Class Reference

#include <AliasAnalysis.h>

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

List of all members.

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 DataLayoutgetDataLayout () const
const TargetLibraryInfogetTargetLibraryInfo () 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.
AliasResult alias (const Value *V1, const Value *V2)
 alias - A convenience wrapper.
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.
bool isNoAlias (const Value *V1, const Value *V2)
 isNoAlias - A convenience wrapper.
bool isMustAlias (const Location &LocA, const Location &LocB)
 isMustAlias - A convenience wrapper.
bool isMustAlias (const Value *V1, const Value *V2)
 isMustAlias - A convenience wrapper.
virtual bool pointsToConstantMemory (const Location &Loc, bool OrLocal=false)
bool pointsToConstantMemory (const Value *P, bool OrLocal=false)
 pointsToConstantMemory - A convenient wrapper.
virtual Location getArgLocation (ImmutableCallSite CS, unsigned ArgIdx, ModRefResult &Mask)
virtual ModRefBehavior getModRefBehavior (ImmutableCallSite CS)
 getModRefBehavior - Return the behavior when calling the given call site.
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.
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.
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.
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.
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.
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.
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.
ModRefResult getModRefInfo (const AtomicCmpXchgInst *CX, const Location &Loc)
ModRefResult getModRefInfo (const AtomicCmpXchgInst *CX, const Value *P, unsigned Size)
 getModRefInfo (for cmpxchges) - A convenience wrapper.
ModRefResult getModRefInfo (const AtomicRMWInst *RMW, const Location &Loc)
ModRefResult getModRefInfo (const AtomicRMWInst *RMW, const Value *P, unsigned Size)
 getModRefInfo (for atomicrmws) - A convenience wrapper.
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.
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.
bool canBasicBlockModify (const BasicBlock &BB, const Location &Loc)
bool canBasicBlockModify (const BasicBlock &BB, const Value *P, uint64_t Size)
 canBasicBlockModify - A convenience wrapper.
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.
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 DataLayoutDL
const TargetLibraryInfoTLI

Detailed Description

Definition at line 57 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 237 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 163 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 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 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 243 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 233 of file AliasAnalysis.h.


Constructor & Destructor Documentation

Definition at line 79 of file AliasAnalysis.h.

Definition at line 461 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 80 of file AliasAnalysis.cpp.

References addEscapingUse().

Referenced by addEscapingUse(), and ConstructSSAForLoadSet().

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().

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

alias - A convenience wrapper.

Definition at line 177 of file AliasAnalysis.h.

References alias().

alias - A convenience wrapper.

Definition at line 183 of file AliasAnalysis.h.

References alias(), and UnknownSize.

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

callCapturesBefore - A convenience wrapper.

Definition at line 495 of file AliasAnalysis.h.

References callCapturesBefore().

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

References llvm::BasicBlock::back(), canInstructionRangeModify(), and llvm::BasicBlock::front().

Referenced by canBasicBlockModify().

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

canBasicBlockModify - A convenience wrapper.

Definition at line 509 of file AliasAnalysis.h.

References canBasicBlockModify().

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

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

Referenced by canBasicBlockModify(), and canInstructionRangeModify().

bool llvm::AliasAnalysis::canInstructionRangeModify ( const Instruction I1,
const Instruction I2,
const Value Ptr,
uint64_t  Size 
) [inline]

canInstructionRangeModify - A convenience wrapper.

Definition at line 521 of file AliasAnalysis.h.

References canInstructionRangeModify().

void AliasAnalysis::copyValue ( Value From,
Value To 
) [virtual]

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

References copyValue().

Referenced by ConstructSSAForLoadSet(), llvm::AliasSetTracker::copyValue(), copyValue(), insertUniqueBackedgeBlock(), replaceWithNewValue(), and UpdatePHINodes().

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

References deleteValue().

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

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

References ArgumentPointees, and ModRef.

Referenced by getModRefInfo().

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

References DoesNotAccessMemory, and getModRefBehavior().

void AliasAnalysis::getAnalysisUsage ( AnalysisUsage AU) const [protected, virtual]

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

Reimplemented in llvm::LibCallAliasAnalysis.

Definition at line 475 of file AliasAnalysis.cpp.

References llvm::AnalysisUsage::addRequired().

Get the location associated with a pointer argument of a callsite. The mask bits are set to indicate the allowed aliasing ModRef kinds. Note that these mask 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 getArgLocation().

Referenced by getArgLocation(), and getModRefInfo().

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

Definition at line 90 of file AliasAnalysis.h.

References DL.

Referenced by getLocForWrite(), getPointerSize(), and isOverwrite().

getLocation - Fill in Loc with information about the memory reference by the given instruction.

Definition at line 254 of file AliasAnalysis.cpp.

References llvm::Instruction::getAAMetadata(), llvm::LoadInst::getPointerOperand(), llvm::Value::getType(), and getTypeStoreSize().

Referenced by GetLocation(), getLocForWrite(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), and isSafeToMove().

getModRefBehavior - Return the behavior when calling the given function. For use when the call site is not known.

Definition at line 245 of file AliasAnalysis.cpp.

References getModRefBehavior().

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

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

Referenced by llvm::AliasSet::aliasesPointer(), llvm::AliasSet::aliasesUnknownInst(), canInstructionRangeModify(), llvm::FindAvailableLoadedValue(), getModRefInfo(), llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(), isSafeToMove(), and mayLoopAccessLocation().

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

getModRefInfo - A convenience wrapper.

Definition at line 381 of file AliasAnalysis.h.

References getModRefInfo().

ModRefResult llvm::AliasAnalysis::getModRefInfo ( ImmutableCallSite  CS,
const Value P,
uint64_t  Size 
) [inline]

getModRefInfo (for call sites) - A convenience wrapper.

Definition at line 392 of file AliasAnalysis.h.

References getModRefInfo().

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

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

References getModRefInfo().

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

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

References getModRefInfo().

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

Definition at line 327 of file AliasAnalysis.cpp.

References alias(), getLocation(), llvm::LoadInst::isUnordered(), ModRef, NoModRef, 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 426 of file AliasAnalysis.h.

References getModRefInfo().

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

Definition at line 342 of file AliasAnalysis.cpp.

References alias(), getLocation(), llvm::StoreInst::isUnordered(), Mod, ModRef, NoModRef, and pointsToConstantMemory().

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

getModRefInfo (for stores) - A convenience wrapper.

Definition at line 435 of file AliasAnalysis.h.

References getModRefInfo().

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

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

References getModRefInfo().

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

Definition at line 378 of file AliasAnalysis.cpp.

References alias(), getLocation(), llvm::AtomicCmpXchgInst::getSuccessOrdering(), ModRef, llvm::Monotonic, and NoModRef.

getModRefInfo (for cmpxchges) - A convenience wrapper.

Definition at line 457 of file AliasAnalysis.h.

References getModRefInfo().

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

Definition at line 391 of file AliasAnalysis.cpp.

References alias(), getLocation(), llvm::AtomicRMWInst::getOrdering(), ModRef, llvm::Monotonic, and NoModRef.

getModRefInfo (for atomicrmws) - A convenience wrapper.

Definition at line 467 of file AliasAnalysis.h.

References getModRefInfo().

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

Definition at line 362 of file AliasAnalysis.cpp.

References alias(), getLocation(), ModRef, NoModRef, and pointsToConstantMemory().

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

getModRefInfo (for va_args) - A convenience wrapper.

Definition at line 477 of file AliasAnalysis.h.

References getModRefInfo().

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

Definition at line 95 of file AliasAnalysis.h.

References TLI.

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

getTypeStoreSize - Return the DataLayout store size for the given type, if known, or a conservative value otherwise.

Definition at line 482 of file AliasAnalysis.cpp.

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

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

void AliasAnalysis::InitializeAliasAnalysis ( Pass P) [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 466 of file AliasAnalysis.cpp.

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

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

isMustAlias - A convenience wrapper.

Definition at line 205 of file AliasAnalysis.h.

References alias(), and MustAlias.

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

isMustAlias - A convenience wrapper.

Definition at line 210 of file AliasAnalysis.h.

References alias(), and MustAlias.

bool llvm::AliasAnalysis::isNoAlias ( const Location LocA,
const Location LocB 
) [inline]

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

Definition at line 189 of file AliasAnalysis.h.

References alias(), and 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 194 of file AliasAnalysis.h.

References isNoAlias().

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

isNoAlias - A convenience wrapper.

Definition at line 200 of file AliasAnalysis.h.

References isNoAlias().

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

References Anywhere, and ArgumentPointees.

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

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

References getModRefBehavior(), and onlyReadsMemory().

static bool llvm::AliasAnalysis::onlyReadsMemory ( ModRefBehavior  MRB) [inline, static]

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

References Mod.

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

pointsToConstantMemory - A convenient wrapper.

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

References copyValue(), and deleteValue().


Member Data Documentation

char AliasAnalysis::ID = 0 [static]

Definition at line 60 of file AliasAnalysis.h.

Referenced by getTargetLibraryInfo(), and InitializeAliasAnalysis().

uint64_t const llvm::AliasAnalysis::UnknownSize = ~UINT64_C(0) [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 85 of file AliasAnalysis.h.

Referenced by llvm::AliasSetTracker::add(), alias(), getLocation(), getLocationForDest(), getLocationForSource(), getLocForWrite(), getObjectSize(), getPointerSize(), getTypeStoreSize(), isObjectSize(), isObjectSmallerThan(), isOverwrite(), and llvm::AliasSetTracker::remove().


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