LLVM 22.0.0git
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

LLVM_ABI AAResults (const TargetLibraryInfo &TLI)
LLVM_ABI AAResults (AAResults &&Arg)
LLVM_ABI ~AAResults ()
template<typename AAResultT>
void addAAResult (AAResultT &AAResult)
 Register a specific AA result.
void addAADependencyID (AnalysisKey *ID)
 Register a function analysis ID that the results aggregation depends on.
LLVM_ABI bool invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
 Handle invalidation events in the new pass manager.
Alias Queries
LLVM_ABI AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 The main low level interface to the alias analysis implementation.
AliasResult alias (const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
 A convenience wrapper around the primary alias interface.
AliasResult alias (const Value *V1, const Value *V2)
 A convenience wrapper around the primary alias interface.
bool isNoAlias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 A trivial helper function to check to see if the specified pointers are no-alias.
bool isNoAlias (const Value *V1, LocationSize V1Size, const Value *V2, LocationSize V2Size)
 A convenience wrapper around the isNoAlias helper interface.
bool isNoAlias (const Value *V1, const Value *V2)
 A convenience wrapper around the isNoAlias helper interface.
bool isMustAlias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 A trivial helper function to check to see if the specified pointers are must-alias.
bool isMustAlias (const Value *V1, const Value *V2)
 A convenience wrapper around the isMustAlias helper interface.
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.
bool pointsToConstantMemory (const Value *P, bool OrLocal=false)
 A convenience wrapper around the primary pointsToConstantMemory interface.
Simple mod/ref information
LLVM_ABI ModRefInfo getModRefInfoMask (const MemoryLocation &Loc, bool IgnoreLocals=false)
 Returns a bitmask that should be unconditionally applied to the ModRef info of a memory location.
ModRefInfo getModRefInfoMask (const Value *P, bool IgnoreLocals=false)
 A convenience wrapper around the primary getModRefInfoMask interface.
LLVM_ABI ModRefInfo getArgModRefInfo (const CallBase *Call, unsigned ArgIdx)
 Get the ModRef info associated with a pointer argument of a call.
LLVM_ABI MemoryEffects getMemoryEffects (const CallBase *Call)
 Return the behavior of the given call site.
LLVM_ABI MemoryEffects getMemoryEffects (const Function *F)
 Return the behavior when calling the given function.
bool doesNotAccessMemory (const CallBase *Call)
 Checks if the specified call is known to never read or write memory.
bool doesNotAccessMemory (const Function *F)
 Checks if the specified function is known to never read or write memory.
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).
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).
ModRefInfo getModRefInfo (const Instruction *I, const std::optional< MemoryLocation > &OptLoc)
 Check whether or not an instruction may read or write the optionally specified memory location.
ModRefInfo getModRefInfo (const Instruction *I, const Value *P, LocationSize Size)
 A convenience wrapper for constructing the memory location.
LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I, const CallBase *Call)
 Return information about whether a call and an instruction may refer to the same memory locations.
LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I1, const Instruction *I2)
 Return information about whether two instructions may refer to the same memory locations.
ModRefInfo callCapturesBefore (const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
 Return information about whether a particular call site modifies or reads the specified memory location MemLoc before instruction I in a BasicBlock.
ModRefInfo callCapturesBefore (const Instruction *I, const Value *P, LocationSize Size, DominatorTree *DT)
 A convenience wrapper to synthesize a memory location.

Higher level methods for querying mod/ref information.

class AAResultBase
class BatchAAResults
LLVM_ABI 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.
bool canBasicBlockModify (const BasicBlock &BB, const Value *P, LocationSize Size)
 A convenience wrapper synthesizing a memory location.
LLVM_ABI 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.
bool canInstructionRangeModRef (const Instruction &I1, const Instruction &I2, const Value *Ptr, LocationSize Size, const ModRefInfo Mode)
 A convenience wrapper synthesizing a memory location.
LLVM_ABI AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI=nullptr)
LLVM_ABI AliasResult aliasErrno (const MemoryLocation &Loc, const Module *M)
LLVM_ABI ModRefInfo getModRefInfoMask (const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals=false)
LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I, const CallBase *Call2, AAQueryInfo &AAQIP)
LLVM_ABI ModRefInfo getModRefInfo (const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const VAArgInst *V, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const LoadInst *L, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const StoreInst *S, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const FenceInst *S, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const AtomicCmpXchgInst *CX, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const AtomicRMWInst *RMW, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const CatchPadInst *I, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const CatchReturnInst *I, const MemoryLocation &Loc, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I, const std::optional< MemoryLocation > &OptLoc, AAQueryInfo &AAQIP)
LLVM_ABI ModRefInfo getModRefInfo (const Instruction *I1, const Instruction *I2, AAQueryInfo &AAQI)
LLVM_ABI ModRefInfo callCapturesBefore (const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT, AAQueryInfo &AAQIP)
 Return information about whether a particular call site modifies or reads the specified memory location MemLoc before instruction I in a BasicBlock.
LLVM_ABI MemoryEffects getMemoryEffects (const CallBase *Call, AAQueryInfo &AAQI)

Detailed Description

Definition at line 318 of file AliasAnalysis.h.

Constructor & Destructor Documentation

◆ AAResults() [1/2]

AAResults::AAResults ( const TargetLibraryInfo & TLI)

Definition at line 73 of file AliasAnalysis.cpp.

Referenced by AAResults().

◆ AAResults() [2/2]

AAResults::AAResults ( AAResults && Arg)

Definition at line 75 of file AliasAnalysis.cpp.

References AAResults(), and llvm::move().

◆ ~AAResults()

AAResults::~AAResults ( )

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

◆ addAAResult()

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

Register a specific AA result.

Definition at line 327 of file AliasAnalysis.h.

Referenced by llvm::AMDGPUPassConfig::addIRPasses().

◆ alias() [1/4]

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

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

References alias().

Referenced by alias(), alias(), alias(), callCapturesBefore(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), llvm::BasicAAResult::getModRefInfo(), isMustAlias(), isMustAlias(), and isNoAlias().

◆ alias() [2/4]

◆ alias() [3/4]

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

A convenience wrapper around the primary alias interface.

Definition at line 366 of file AliasAnalysis.h.

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

◆ alias() [4/4]

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

References alias().

◆ aliasErrno()

AliasResult AAResults::aliasErrno ( const MemoryLocation & Loc,
const Module * M )

Definition at line 151 of file AliasAnalysis.cpp.

References llvm::AliasResult::MayAlias.

Referenced by llvm::BasicAAResult::getModRefInfo().

◆ callCapturesBefore() [1/3]

ModRefInfo llvm::AAResults::callCapturesBefore ( const Instruction * I,
const MemoryLocation & MemLoc,
DominatorTree * DT )
inline

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

Definition at line 537 of file AliasAnalysis.h.

References callCapturesBefore(), and I.

Referenced by callCapturesBefore(), and callCapturesBefore().

◆ callCapturesBefore() [2/3]

ModRefInfo AAResults::callCapturesBefore ( const Instruction * I,
const MemoryLocation & MemLoc,
DominatorTree * DT,
AAQueryInfo & AAQI )

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

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

References alias(), Call, llvm::capturesAnyProvenance(), llvm::capturesAnything(), llvm::dyn_cast(), llvm::MemoryLocation::getBeforeOrAfter(), llvm::CaptureInfo::getOtherComponents(), llvm::getUnderlyingObject(), I, llvm::isIdentifiedFunctionLocal(), llvm::ModRef, llvm::AliasResult::NoAlias, llvm::NoModRef, llvm::PointerMayBeCapturedBefore(), llvm::Provenance, llvm::MemoryLocation::Ptr, and llvm::Ref.

◆ callCapturesBefore() [3/3]

ModRefInfo llvm::AAResults::callCapturesBefore ( const Instruction * I,
const Value * P,
LocationSize Size,
DominatorTree * DT )
inline

A convenience wrapper to synthesize a memory location.

Definition at line 545 of file AliasAnalysis.h.

References callCapturesBefore(), I, P, and Size.

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

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

Referenced by canBasicBlockModify(), and findArgParts().

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

References canBasicBlockModify(), P, and Size.

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

References assert(), llvm::ilist_node_impl< OptionsT >::getIterator(), getModRefInfo(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), I, and llvm::isModOrRefSet().

Referenced by canBasicBlockModify(), canInstructionRangeModRef(), and findArgParts().

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

References canInstructionRangeModRef(), Mode, Ptr, and Size.

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

References Call, llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), and getMemoryEffects().

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

References llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory(), F, and getMemoryEffects().

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

Definition at line 184 of file AliasAnalysis.cpp.

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

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

◆ getMemoryEffects() [1/3]

◆ getMemoryEffects() [2/3]

MemoryEffects AAResults::getMemoryEffects ( const CallBase * Call,
AAQueryInfo & AAQI )

Definition at line 374 of file AliasAnalysis.cpp.

References Call, and llvm::MemoryEffectsBase< IRMemLocation >::unknown().

◆ getMemoryEffects() [3/3]

MemoryEffects AAResults::getMemoryEffects ( const Function * F)

Return the behavior when calling the given function.

Definition at line 394 of file AliasAnalysis.cpp.

References F, and llvm::MemoryEffectsBase< IRMemLocation >::unknown().

◆ getModRefInfo() [1/17]

◆ getModRefInfo() [2/17]

◆ getModRefInfo() [3/17]

ModRefInfo AAResults::getModRefInfo ( const CallBase * Call,
const MemoryLocation & Loc,
AAQueryInfo & AAQI )

◆ getModRefInfo() [4/17]

◆ getModRefInfo() [5/17]

ModRefInfo AAResults::getModRefInfo ( const CatchPadInst * I,
const MemoryLocation & Loc,
AAQueryInfo & AAQI )

Definition at line 506 of file AliasAnalysis.cpp.

References getModRefInfoMask(), and llvm::ModRef.

◆ getModRefInfo() [6/17]

ModRefInfo AAResults::getModRefInfo ( const CatchReturnInst * I,
const MemoryLocation & Loc,
AAQueryInfo & AAQI )

Definition at line 519 of file AliasAnalysis.cpp.

References getModRefInfoMask(), and llvm::ModRef.

◆ getModRefInfo() [7/17]

ModRefInfo AAResults::getModRefInfo ( const FenceInst * S,
const MemoryLocation & Loc,
AAQueryInfo & AAQI )

Definition at line 476 of file AliasAnalysis.cpp.

References getModRefInfoMask(), and llvm::ModRef.

◆ getModRefInfo() [8/17]

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

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

Definition at line 198 of file AliasAnalysis.cpp.

References getModRefInfo(), and I.

◆ getModRefInfo() [9/17]

ModRefInfo AAResults::getModRefInfo ( const Instruction * I,
const CallBase * Call2,
AAQueryInfo & AAQIP )

◆ getModRefInfo() [10/17]

ModRefInfo llvm::AAResults::getModRefInfo ( const Instruction * I,
const std::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 513 of file AliasAnalysis.h.

References getModRefInfo(), and I.

Referenced by canInstructionRangeModRef(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), and isArgUnmodifiedByAllCalls().

◆ getModRefInfo() [11/17]

ModRefInfo AAResults::getModRefInfo ( const Instruction * I,
const std::optional< MemoryLocation > & OptLoc,
AAQueryInfo & AAQIP )

◆ getModRefInfo() [12/17]

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

A convenience wrapper for constructing the memory location.

Definition at line 520 of file AliasAnalysis.h.

References getModRefInfo(), I, P, and Size.

◆ getModRefInfo() [13/17]

ModRefInfo AAResults::getModRefInfo ( const Instruction * I1,
const Instruction * I2 )

Return information about whether two instructions may refer to the same memory locations.

Definition at line 354 of file AliasAnalysis.cpp.

References getModRefInfo().

◆ getModRefInfo() [14/17]

◆ getModRefInfo() [15/17]

◆ getModRefInfo() [16/17]

◆ getModRefInfo() [17/17]

◆ getModRefInfoMask() [1/3]

ModRefInfo AAResults::getModRefInfoMask ( const MemoryLocation & Loc,
AAQueryInfo & AAQI,
bool IgnoreLocals = false )

Definition at line 169 of file AliasAnalysis.cpp.

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

◆ getModRefInfoMask() [2/3]

ModRefInfo AAResults::getModRefInfoMask ( const MemoryLocation & Loc,
bool IgnoreLocals = false )

Returns a bitmask that should be unconditionally applied to the ModRef info of a memory location.

This allows us to eliminate Mod and/or Ref from the ModRef info based on the knowledge that the memory location points to constant and/or locally-invariant memory.

If IgnoreLocals is true, then this method returns NoModRef for memory that points to a local alloca.

Definition at line 163 of file AliasAnalysis.cpp.

References getModRefInfoMask().

Referenced by addLocAccess(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfo(), getModRefInfoMask(), getModRefInfoMask(), and pointsToConstantMemory().

◆ getModRefInfoMask() [3/3]

ModRefInfo llvm::AAResults::getModRefInfoMask ( const Value * P,
bool IgnoreLocals = false )
inline

A convenience wrapper around the primary getModRefInfoMask interface.

Definition at line 430 of file AliasAnalysis.h.

References llvm::MemoryLocation::getBeforeOrAfter(), getModRefInfoMask(), and P.

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

References F, and llvm::PreservedAnalyses::getChecker().

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

References alias(), and llvm::AliasResult::MustAlias.

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

References alias(), llvm::AliasResult::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 373 of file AliasAnalysis.h.

References alias(), and llvm::AliasResult::NoAlias.

Referenced by isNoAlias(), and isNoAlias().

◆ isNoAlias() [2/3]

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

A convenience wrapper around the isNoAlias helper interface.

Definition at line 384 of file AliasAnalysis.h.

References llvm::MemoryLocation::getBeforeOrAfter(), and isNoAlias().

◆ isNoAlias() [3/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 378 of file AliasAnalysis.h.

References isNoAlias().

◆ onlyReadsMemory() [1/2]

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

References Call, getMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::onlyReadsMemory().

◆ onlyReadsMemory() [2/2]

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

References F, getMemoryEffects(), and llvm::MemoryEffectsBase< LocationEnum >::onlyReadsMemory().

◆ pointsToConstantMemory() [1/2]

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

Checks whether the given location points to constant memory, or if OrLocal is true whether it points to a local alloca.

Definition at line 403 of file AliasAnalysis.h.

References getModRefInfoMask(), and llvm::isNoModRef().

Referenced by pointsToConstantMemory().

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

References llvm::MemoryLocation::getBeforeOrAfter(), P, and pointsToConstantMemory().

◆ AAResultBase

friend class AAResultBase
friend

Definition at line 640 of file AliasAnalysis.h.

References AAResultBase.

Referenced by AAResultBase.

◆ BatchAAResults

friend class BatchAAResults
friend

Definition at line 648 of file AliasAnalysis.h.

References BatchAAResults.

Referenced by BatchAAResults.


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