LLVM  8.0.1
Classes | Public Member Functions | List of all members
llvm::AAResults Class Reference

#include "llvm/Analysis/AliasAnalysis.h"

Classes

class  Concept
 A private abstract base class describing the concept of an individual alias analysis implementation. More...
 

Public Member Functions

 AAResults (const TargetLibraryInfo &TLI)
 
 AAResults (AAResults &&Arg)
 
 ~AAResults ()
 
template<typename AAResultT >
void addAAResult (AAResultT &AAResult)
 Register a specific AA result. More...
 
void addAADependencyID (AnalysisKey *ID)
 Register a function analysis ID that the results aggregation depends on. More...
 
bool invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
 Handle invalidation events in the new pass manager. More...
 
Alias Queries
AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 The main low level interface to the alias analysis implementation. More...
 
AliasResult alias (const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
 A convenience wrapper around the primary alias interface. More...
 
AliasResult alias (const Value *V1, const Value *V2)
 A convenience wrapper around the primary alias interface. More...
 
bool isNoAlias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 A trivial helper function to check to see if the specified pointers are no-alias. More...
 
bool isNoAlias (const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
 A convenience wrapper around the isNoAlias helper interface. More...
 
bool isNoAlias (const Value *V1, const Value *V2)
 A convenience wrapper around the isNoAlias helper interface. More...
 
bool isMustAlias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 A trivial helper function to check to see if the specified pointers are must-alias. More...
 
bool isMustAlias (const Value *V1, const Value *V2)
 A convenience wrapper around the isMustAlias helper interface. More...
 
bool pointsToConstantMemory (const MemoryLocation &Loc, bool OrLocal=false)
 Checks whether the given location points to constant memory, or if OrLocal is true whether it points to a local alloca. More...
 
bool pointsToConstantMemory (const Value *P, bool OrLocal=false)
 A convenience wrapper around the primary pointsToConstantMemory interface. More...
 

Simple mod/ref information

ModRefInfo getArgModRefInfo (const CallBase *Call, unsigned ArgIdx)
 Get the ModRef info associated with a pointer argument of a call. More...
 
FunctionModRefBehavior getModRefBehavior (const CallBase *Call)
 Return the behavior of the given call site. More...
 
FunctionModRefBehavior getModRefBehavior (const Function *F)
 Return the behavior when calling the given function. More...
 
bool doesNotAccessMemory (const CallBase *Call)
 Checks if the specified call is known to never read or write memory. More...
 
bool doesNotAccessMemory (const Function *F)
 Checks if the specified function is known to never read or write memory. More...
 
bool onlyReadsMemory (const CallBase *Call)
 Checks if the specified call is known to only read from non-volatile memory (or not access memory at all). More...
 
bool onlyReadsMemory (const Function *F)
 Checks if the specified function is known to only read from non-volatile memory (or not access memory at all). More...
 
ModRefInfo getModRefInfo (const CallBase *Call, const MemoryLocation &Loc)
 getModRefInfo (for call sites) - Return information about whether a particular call site modifies or reads the specified memory location. More...
 
ModRefInfo getModRefInfo (const CallBase *Call, const Value *P, LocationSize Size)
 getModRefInfo (for call sites) - A convenience wrapper. More...
 
ModRefInfo 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...
 
ModRefInfo getModRefInfo (const LoadInst *L, const Value *P, LocationSize Size)
 getModRefInfo (for loads) - A convenience wrapper. More...
 
ModRefInfo 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...
 
ModRefInfo getModRefInfo (const StoreInst *S, const Value *P, LocationSize Size)
 getModRefInfo (for stores) - A convenience wrapper. More...
 
ModRefInfo 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...
 
ModRefInfo getModRefInfo (const FenceInst *S, const Value *P, LocationSize Size)
 getModRefInfo (for fences) - A convenience wrapper. More...
 
ModRefInfo 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...
 
ModRefInfo getModRefInfo (const AtomicCmpXchgInst *CX, const Value *P, LocationSize Size)
 getModRefInfo (for cmpxchges) - A convenience wrapper. More...
 
ModRefInfo 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...
 
ModRefInfo getModRefInfo (const AtomicRMWInst *RMW, const Value *P, LocationSize Size)
 getModRefInfo (for atomicrmws) - A convenience wrapper. More...
 
ModRefInfo 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...
 
ModRefInfo getModRefInfo (const VAArgInst *I, const Value *P, LocationSize Size)
 getModRefInfo (for va_args) - A convenience wrapper. More...
 
ModRefInfo getModRefInfo (const CatchPadInst *I, const MemoryLocation &Loc)
 getModRefInfo (for catchpads) - Return information about whether a particular catchpad modifies or reads the specified memory location. More...
 
ModRefInfo getModRefInfo (const CatchPadInst *I, const Value *P, LocationSize Size)
 getModRefInfo (for catchpads) - A convenience wrapper. More...
 
ModRefInfo getModRefInfo (const CatchReturnInst *I, const MemoryLocation &Loc)
 getModRefInfo (for catchrets) - Return information about whether a particular catchret modifies or reads the specified memory location. More...
 
ModRefInfo getModRefInfo (const CatchReturnInst *I, const Value *P, LocationSize Size)
 getModRefInfo (for catchrets) - A convenience wrapper. More...
 
ModRefInfo getModRefInfo (const Instruction *I, const Optional< MemoryLocation > &OptLoc)
 Check whether or not an instruction may read or write the optionally specified memory location. More...
 
ModRefInfo getModRefInfo (const Instruction *I, const Value *P, LocationSize Size)
 A convenience wrapper for constructing the memory location. More...
 
ModRefInfo getModRefInfo (Instruction *I, const CallBase *Call)
 Return information about whether a call and an instruction may refer to the same memory locations. More...
 
ModRefInfo getModRefInfo (const CallBase *Call1, const CallBase *Call2)
 Return information about whether two call sites may refer to the same set of memory locations. More...
 
ModRefInfo callCapturesBefore (const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT, OrderedBasicBlock *OBB=nullptr)
 Return information about whether a particular call site modifies or reads the specified memory location MemLoc before instruction I in a BasicBlock. More...
 
ModRefInfo callCapturesBefore (const Instruction *I, const Value *P, LocationSize Size, DominatorTree *DT, OrderedBasicBlock *OBB=nullptr)
 A convenience wrapper to synthesize a memory location. More...
 
static bool onlyReadsMemory (FunctionModRefBehavior MRB)
 Checks if functions with the specified behavior are known to only read from non-volatile memory (or not access memory at all). More...
 
static bool doesNotReadMemory (FunctionModRefBehavior MRB)
 Checks if functions with the specified behavior are known to only write memory (or not access memory at all). More...
 
static bool onlyAccessesArgPointees (FunctionModRefBehavior MRB)
 Checks 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 (FunctionModRefBehavior MRB)
 Checks 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 bool onlyAccessesInaccessibleMem (FunctionModRefBehavior MRB)
 Checks if functions with the specified behavior are known to read and write at most from memory that is inaccessible from LLVM IR. More...
 
static bool doesAccessInaccessibleMem (FunctionModRefBehavior MRB)
 Checks if functions with the specified behavior are known to potentially read or write from memory that is inaccessible from LLVM IR. More...
 
static bool onlyAccessesInaccessibleOrArgMem (FunctionModRefBehavior MRB)
 Checks if functions with the specified behavior are known to read and write at most from memory that is inaccessible from LLVM IR or objects pointed to by their pointer-typed arguments (with arbitrary offsets). More...
 

Higher level methods for querying mod/ref information.

template<typename T >
class AAResultBase
 
bool canBasicBlockModify (const BasicBlock &BB, const MemoryLocation &Loc)
 Check if it is possible for execution of the specified basic block to modify the location Loc. More...
 
bool canBasicBlockModify (const BasicBlock &BB, const Value *P, LocationSize Size)
 A convenience wrapper synthesizing a memory location. More...
 
bool canInstructionRangeModRef (const Instruction &I1, const Instruction &I2, const MemoryLocation &Loc, const ModRefInfo Mode)
 Check 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, LocationSize Size, const ModRefInfo Mode)
 A convenience wrapper synthesizing a memory location. More...
 

Detailed Description

Definition at line 289 of file AliasAnalysis.h.

Constructor & Destructor Documentation

◆ AAResults() [1/2]

llvm::AAResults::AAResults ( const TargetLibraryInfo TLI)
inline

Definition at line 293 of file AliasAnalysis.h.

References Arg.

◆ AAResults() [2/2]

AAResults::AAResults ( AAResults &&  Arg)

Definition at line 64 of file AliasAnalysis.cpp.

◆ ~AAResults()

AAResults::~AAResults ( )

Definition at line 70 of file AliasAnalysis.cpp.

Member Function Documentation

◆ addAADependencyID()

void llvm::AAResults::addAADependencyID ( AnalysisKey ID)
inline

Register a function analysis ID that the results aggregation depends on.

This is used in the new pass manager to implement the invalidation logic where we must invalidate the results aggregation if any of our component analyses become invalid.

Definition at line 310 of file AliasAnalysis.h.

References F().

Referenced by llvm::AAManager::run().

◆ addAAResult()

template<typename AAResultT >
void llvm::AAResults::addAAResult ( AAResultT &  AAResult)
inline

Register a specific AA result.

Definition at line 298 of file AliasAnalysis.h.

Referenced by llvm::GCNTargetMachine::getTargetTransformInfo(), and llvm::AAManager::run().

◆ alias() [1/3]

AliasResult AAResults::alias ( const MemoryLocation LocA,
const MemoryLocation LocB 
)

◆ alias() [2/3]

AliasResult llvm::AAResults::alias ( const Value V1,
LocationSize  V1Size,
const Value V2,
LocationSize  V2Size 
)
inline

A convenience wrapper around the primary alias interface.

Definition at line 330 of file AliasAnalysis.h.

◆ alias() [3/3]

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

A convenience wrapper around the primary alias interface.

Definition at line 336 of file AliasAnalysis.h.

References llvm::LocationSize::unknown().

◆ callCapturesBefore() [1/2]

ModRefInfo AAResults::callCapturesBefore ( const Instruction I,
const MemoryLocation MemLoc,
DominatorTree DT,
OrderedBasicBlock OBB = nullptr 
)

Return information about whether a particular call site modifies or reads the specified memory location MemLoc before instruction I in a BasicBlock.

An ordered basic block OBB can be used to speed up instruction ordering queries inside the BasicBlock containing I. Early exits in callCapturesBefore may lead to ModRefInfo::Must not being set.

An ordered basic block OBB can be used to speed up instruction-ordering queries inside the BasicBlock containing I. FIXME: this is really just shoring-up a deficiency in alias analysis. BasicAA isn't willing to spend linear time determining whether an alloca was captured before or after this particular call, while we are. However, with a smarter AA in place, this test is just wasting compile time.

Definition at line 551 of file AliasAnalysis.cpp.

References alias(), llvm::clearMust(), llvm::dyn_cast(), llvm::Module::getDataLayout(), llvm::Instruction::getModule(), llvm::GetUnderlyingObject(), I, llvm::isIdentifiedObject(), llvm::ModRef, llvm::MustAlias, llvm::NoAlias, llvm::NoModRef, llvm::PointerMayBeCapturedBefore(), llvm::MemoryLocation::Ptr, llvm::Ref, and llvm::setMust().

Referenced by llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), and moveUp().

◆ callCapturesBefore() [2/2]

ModRefInfo llvm::AAResults::callCapturesBefore ( const Instruction I,
const Value P,
LocationSize  Size,
DominatorTree DT,
OrderedBasicBlock OBB = nullptr 
)
inline

A convenience wrapper to synthesize a memory location.

Definition at line 657 of file AliasAnalysis.h.

◆ canBasicBlockModify() [1/2]

bool AAResults::canBasicBlockModify ( const BasicBlock BB,
const MemoryLocation Loc 
)

Check if it is possible for execution of the specified basic block to modify the location Loc.

canBasicBlockModify - Return true if it is possible for execution of the specified basic block to modify the location Loc.

Definition at line 612 of file AliasAnalysis.cpp.

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

Referenced by isSafeToPromoteArgument().

◆ canBasicBlockModify() [2/2]

bool llvm::AAResults::canBasicBlockModify ( const BasicBlock BB,
const Value P,
LocationSize  Size 
)
inline

A convenience wrapper synthesizing a memory location.

Definition at line 673 of file AliasAnalysis.h.

References Mode.

◆ canInstructionRangeModRef() [1/2]

bool AAResults::canInstructionRangeModRef ( const Instruction I1,
const Instruction I2,
const MemoryLocation Loc,
const ModRefInfo  Mode 
)

Check if it is possible for the execution of the specified instructions to mod(according to the mode) the location Loc.

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

References assert(), E, llvm::ilist_node_impl< OptionsT >::getIterator(), getModRefInfo(), llvm::Instruction::getParent(), I, llvm::ExternalAAWrapperPass::ID, llvm::intersectModRef(), llvm::isModOrRefSet(), and llvm::AAResults::Concept::~Concept().

Referenced by canBasicBlockModify(), and isSafeToPromoteArgument().

◆ canInstructionRangeModRef() [2/2]

bool llvm::AAResults::canInstructionRangeModRef ( const Instruction I1,
const Instruction I2,
const Value Ptr,
LocationSize  Size,
const ModRefInfo  Mode 
)
inline

A convenience wrapper synthesizing a memory location.

Definition at line 688 of file AliasAnalysis.h.

◆ doesAccessArgPointees()

static bool llvm::AAResults::doesAccessArgPointees ( FunctionModRefBehavior  MRB)
inlinestatic

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

References llvm::createModRefInfo(), llvm::FMRL_ArgumentPointees, and llvm::isModOrRefSet().

Referenced by getModRefInfo().

◆ doesAccessInaccessibleMem()

static bool llvm::AAResults::doesAccessInaccessibleMem ( FunctionModRefBehavior  MRB)
inlinestatic

Checks if functions with the specified behavior are known to potentially read or write from memory that is inaccessible from LLVM IR.

Definition at line 488 of file AliasAnalysis.h.

References llvm::createModRefInfo(), llvm::FMRL_InaccessibleMem, and llvm::isModOrRefSet().

◆ doesNotAccessMemory() [1/2]

bool llvm::AAResults::doesNotAccessMemory ( const CallBase Call)
inline

Checks if the specified call is known to never read or write memory.

Note that if the call only reads from known-constant memory, it is also legal to return true. Also, 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 408 of file AliasAnalysis.h.

References llvm::FMRB_DoesNotAccessMemory.

Referenced by handleEndBlock().

◆ doesNotAccessMemory() [2/2]

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

Checks if the specified function is known to never read or write memory.

Note that if the function only reads from known-constant memory, it is also legal to return true. Also, function that unwind the stack are legal for this predicate.

Many optimizations (such as CSE and LICM) can be performed on such calls to such functions without worrying about aliasing properties, and many functions have this property (e.g. 'sin' and 'cos').

This property corresponds to the GCC 'const' attribute.

Definition at line 423 of file AliasAnalysis.h.

References llvm::FMRB_DoesNotAccessMemory.

◆ doesNotReadMemory()

static bool llvm::AAResults::doesNotReadMemory ( FunctionModRefBehavior  MRB)
inlinestatic

Checks if functions with the specified behavior are known to only write memory (or not access memory at all).

Definition at line 461 of file AliasAnalysis.h.

References llvm::createModRefInfo(), and llvm::isRefSet().

Referenced by checkFunctionMemoryAccess(), and getModRefInfo().

◆ getArgModRefInfo()

ModRefInfo AAResults::getArgModRefInfo ( const CallBase Call,
unsigned  ArgIdx 
)

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

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. This never sets ModRefInfo::Must.

Definition at line 120 of file AliasAnalysis.cpp.

References llvm::intersectModRef(), llvm::isNoModRef(), llvm::ModRef, and llvm::NoModRef.

Referenced by llvm::AliasSetTracker::add(), llvm::AAResultBase< DerivedT >::AAResultsProxy::getArgModRefInfo(), and getModRefInfo().

◆ getModRefBehavior() [1/2]

FunctionModRefBehavior AAResults::getModRefBehavior ( const CallBase Call)

◆ getModRefBehavior() [2/2]

FunctionModRefBehavior AAResults::getModRefBehavior ( const Function F)

Return the behavior when calling the given function.

Definition at line 362 of file AliasAnalysis.cpp.

References llvm::FMRB_DoesNotAccessMemory, and llvm::FMRB_UnknownModRefBehavior.

◆ getModRefInfo() [1/22]

ModRefInfo AAResults::getModRefInfo ( const CallBase Call,
const MemoryLocation Loc 
)

◆ getModRefInfo() [2/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const CallBase Call,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for call sites) - A convenience wrapper.

Definition at line 505 of file AliasAnalysis.h.

◆ getModRefInfo() [3/22]

ModRefInfo AAResults::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 398 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::LoadInst::getOrdering(), llvm::isStrongerThan(), llvm::ModRef, llvm::MustAlias, llvm::MustRef, llvm::NoAlias, llvm::NoModRef, llvm::MemoryLocation::Ptr, llvm::Ref, and llvm::Unordered.

◆ getModRefInfo() [4/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const LoadInst L,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for loads) - A convenience wrapper.

Definition at line 515 of file AliasAnalysis.h.

◆ getModRefInfo() [5/22]

ModRefInfo AAResults::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 417 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::StoreInst::getOrdering(), llvm::isStrongerThan(), llvm::Mod, llvm::ModRef, llvm::MustAlias, llvm::MustMod, llvm::NoAlias, llvm::NoModRef, pointsToConstantMemory(), llvm::MemoryLocation::Ptr, and llvm::Unordered.

◆ getModRefInfo() [6/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const StoreInst S,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for stores) - A convenience wrapper.

Definition at line 525 of file AliasAnalysis.h.

◆ getModRefInfo() [7/22]

ModRefInfo AAResults::getModRefInfo ( const FenceInst S,
const MemoryLocation Loc 
)

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

Definition at line 444 of file AliasAnalysis.cpp.

References llvm::ModRef, pointsToConstantMemory(), llvm::MemoryLocation::Ptr, and llvm::Ref.

◆ getModRefInfo() [8/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const FenceInst S,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for fences) - A convenience wrapper.

Definition at line 535 of file AliasAnalysis.h.

◆ getModRefInfo() [9/22]

ModRefInfo AAResults::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 501 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::AtomicCmpXchgInst::getSuccessOrdering(), llvm::isStrongerThanMonotonic(), llvm::ModRef, llvm::MustAlias, llvm::MustModRef, llvm::NoAlias, llvm::NoModRef, and llvm::MemoryLocation::Ptr.

◆ getModRefInfo() [10/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const AtomicCmpXchgInst CX,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for cmpxchges) - A convenience wrapper.

Definition at line 546 of file AliasAnalysis.h.

◆ getModRefInfo() [11/22]

ModRefInfo AAResults::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 522 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::get(), llvm::AtomicRMWInst::getOrdering(), llvm::isStrongerThanMonotonic(), llvm::ModRef, llvm::MustAlias, llvm::MustModRef, llvm::NoAlias, llvm::NoModRef, and llvm::MemoryLocation::Ptr.

◆ getModRefInfo() [12/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const AtomicRMWInst RMW,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for atomicrmws) - A convenience wrapper.

Definition at line 556 of file AliasAnalysis.h.

References I.

◆ getModRefInfo() [13/22]

ModRefInfo AAResults::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 452 of file AliasAnalysis.cpp.

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

◆ getModRefInfo() [14/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const VAArgInst I,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for va_args) - A convenience wrapper.

Definition at line 566 of file AliasAnalysis.h.

◆ getModRefInfo() [15/22]

ModRefInfo AAResults::getModRefInfo ( const CatchPadInst I,
const MemoryLocation Loc 
)

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

Definition at line 475 of file AliasAnalysis.cpp.

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

◆ getModRefInfo() [16/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const CatchPadInst I,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for catchpads) - A convenience wrapper.

Definition at line 576 of file AliasAnalysis.h.

◆ getModRefInfo() [17/22]

ModRefInfo AAResults::getModRefInfo ( const CatchReturnInst I,
const MemoryLocation Loc 
)

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

Definition at line 488 of file AliasAnalysis.cpp.

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

◆ getModRefInfo() [18/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const CatchReturnInst I,
const Value P,
LocationSize  Size 
)
inline

getModRefInfo (for catchrets) - A convenience wrapper.

Definition at line 586 of file AliasAnalysis.h.

◆ getModRefInfo() [19/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const Instruction I,
const Optional< MemoryLocation > &  OptLoc 
)
inline

Check whether or not an instruction may read or write the optionally specified memory location.

An instruction that doesn't read or write memory may be trivially LICM'd for example.

For function calls, this delegates to the alias-analysis specific call-site mod-ref behavior queries. Otherwise it delegates to the specific helpers above.

Definition at line 601 of file AliasAnalysis.h.

References llvm::MCID::Call, llvm::createModRefInfo(), llvm::Instruction::getOpcode(), llvm::Optional< T >::getValueOr(), llvm::SPII::Load, llvm::NoModRef, llvm::None, and llvm::SPII::Store.

◆ getModRefInfo() [20/22]

ModRefInfo llvm::AAResults::getModRefInfo ( const Instruction I,
const Value P,
LocationSize  Size 
)
inline

A convenience wrapper for constructing the memory location.

Definition at line 632 of file AliasAnalysis.h.

◆ getModRefInfo() [21/22]

ModRefInfo AAResults::getModRefInfo ( Instruction I,
const CallBase Call 
)

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

Definition at line 134 of file AliasAnalysis.cpp.

References llvm::MemoryLocation::get(), getModRefInfo(), llvm::Instruction::isFenceLike(), llvm::isModOrRefSet(), llvm::ModRef, llvm::NoModRef, and llvm::setModAndRef().

◆ getModRefInfo() [22/22]

ModRefInfo AAResults::getModRefInfo ( const CallBase Call1,
const CallBase Call2 
)

◆ invalidate()

bool AAResults::invalidate ( Function F,
const PreservedAnalyses PA,
FunctionAnalysisManager::Invalidator Inv 
)

Handle invalidation events in the new pass manager.

The aggregation is invalidated if any of the underlying analyses is invalidated.

Definition at line 81 of file AliasAnalysis.cpp.

References llvm::PreservedAnalyses::getChecker(), and llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator::invalidate().

◆ isMustAlias() [1/2]

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

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

Definition at line 359 of file AliasAnalysis.h.

References llvm::MustAlias.

Referenced by llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), handleFree(), hasUndefContents(), isOverwrite(), isPossibleSelfRead(), and lifetimeEndsAt().

◆ isMustAlias() [2/2]

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

A convenience wrapper around the isMustAlias helper interface.

Definition at line 364 of file AliasAnalysis.h.

References llvm::MustAlias, and llvm::LocationSize::precise().

◆ isNoAlias() [1/3]

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

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

Definition at line 342 of file AliasAnalysis.h.

References llvm::NoAlias.

Referenced by hasUndefContents(), isPossibleSelfRead(), moveUp(), and removeAccessedObjects().

◆ isNoAlias() [2/3]

bool llvm::AAResults::isNoAlias ( const Value V1,
LocationSize  V1Size,
const Value V2,
LocationSize  V2Size 
)
inline

A convenience wrapper around the isNoAlias helper interface.

Definition at line 347 of file AliasAnalysis.h.

◆ isNoAlias() [3/3]

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

A convenience wrapper around the isNoAlias helper interface.

Definition at line 353 of file AliasAnalysis.h.

◆ onlyAccessesArgPointees()

static bool llvm::AAResults::onlyAccessesArgPointees ( FunctionModRefBehavior  MRB)
inlinestatic

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

References llvm::FMRL_Anywhere, and llvm::FMRL_ArgumentPointees.

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

◆ onlyAccessesInaccessibleMem()

static bool llvm::AAResults::onlyAccessesInaccessibleMem ( FunctionModRefBehavior  MRB)
inlinestatic

Checks if functions with the specified behavior are known to read and write at most from memory that is inaccessible from LLVM IR.

Definition at line 482 of file AliasAnalysis.h.

References llvm::FMRL_Anywhere, and llvm::FMRL_InaccessibleMem.

◆ onlyAccessesInaccessibleOrArgMem()

static bool llvm::AAResults::onlyAccessesInaccessibleOrArgMem ( FunctionModRefBehavior  MRB)
inlinestatic

Checks if functions with the specified behavior are known to read and write at most from memory that is inaccessible from LLVM IR or objects pointed to by their pointer-typed arguments (with arbitrary offsets).

Definition at line 495 of file AliasAnalysis.h.

References llvm::FMRL_Anywhere, llvm::FMRL_ArgumentPointees, and llvm::FMRL_InaccessibleMem.

Referenced by getModRefInfo().

◆ onlyReadsMemory() [1/3]

bool llvm::AAResults::onlyReadsMemory ( const CallBase Call)
inline

Checks if the specified call is known to only read from non-volatile memory (or not access memory at all).

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

Referenced by llvm::objcarc::CanAlterRefCount(), llvm::canSinkOrHoistInst(), checkFunctionMemoryAccess(), llvm::MemoryDependenceResults::getDependency(), getModRefInfo(), and llvm::MemoryDependenceResults::getNonLocalCallDependency().

◆ onlyReadsMemory() [2/3]

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

Checks if the specified function is known to only read from non-volatile memory (or not access memory at all).

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

◆ onlyReadsMemory() [3/3]

static bool llvm::AAResults::onlyReadsMemory ( FunctionModRefBehavior  MRB)
inlinestatic

Checks if functions with the specified behavior are known to only read from non-volatile memory (or not access memory at all).

Definition at line 455 of file AliasAnalysis.h.

References llvm::createModRefInfo(), and llvm::isModSet().

◆ pointsToConstantMemory() [1/2]

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

◆ pointsToConstantMemory() [2/2]

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

A convenience wrapper around the primary pointsToConstantMemory interface.

Definition at line 375 of file AliasAnalysis.h.

Friends And Related Function Documentation

◆ AAResultBase

template<typename T >
friend class AAResultBase
friend

Definition at line 697 of file AliasAnalysis.h.


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