LLVM 17.0.0git
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.
 
void addAADependencyID (AnalysisKey *ID)
 Register a function analysis ID that the results aggregation depends on.
 
bool invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
 Handle invalidation events in the new pass manager.
 
Alias Queries
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
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.
 
ModRefInfo getArgModRefInfo (const CallBase *Call, unsigned ArgIdx)
 Get the ModRef info associated with a pointer argument of a call.
 
MemoryEffects getMemoryEffects (const CallBase *Call)
 Return the behavior of the given call site.
 
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.
 
ModRefInfo getModRefInfo (const Instruction *I, const CallBase *Call)
 Return information about whether a call and an instruction 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
 
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.
 
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.
 
AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI=nullptr)
 
bool pointsToConstantMemory (const MemoryLocation &Loc, AAQueryInfo &AAQI, bool OrLocal=false)
 
ModRefInfo getModRefInfoMask (const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals=false)
 
ModRefInfo getModRefInfo (const Instruction *I, const CallBase *Call2, AAQueryInfo &AAQIP)
 
ModRefInfo getModRefInfo (const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const VAArgInst *V, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const LoadInst *L, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const StoreInst *S, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const FenceInst *S, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const AtomicCmpXchgInst *CX, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const AtomicRMWInst *RMW, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const CatchPadInst *I, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const CatchReturnInst *I, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const Instruction *I, const std::optional< MemoryLocation > &OptLoc, AAQueryInfo &AAQIP)
 
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.
 
MemoryEffects getMemoryEffects (const CallBase *Call, AAQueryInfo &AAQI)
 

Detailed Description

Definition at line 294 of file AliasAnalysis.h.

Constructor & Destructor Documentation

◆ AAResults() [1/2]

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

Definition at line 298 of file AliasAnalysis.h.

◆ AAResults() [2/2]

AAResults::AAResults ( AAResults &&  Arg)

Definition at line 76 of file AliasAnalysis.cpp.

◆ ~AAResults()

AAResults::~AAResults ( )

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

◆ addAAResult()

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

Register a specific AA result.

Definition at line 303 of file AliasAnalysis.h.

Referenced by llvm::AMDGPUPassConfig::addIRPasses(), and llvm::createLegacyPMAAResults().

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

References alias().

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

◆ alias() [2/4]

AliasResult AAResults::alias ( const MemoryLocation LocA,
const MemoryLocation LocB,
AAQueryInfo AAQI,
const Instruction CtxI = nullptr 
)

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

References alias().

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

References callCapturesBefore(), and I.

Referenced by callCapturesBefore(), and llvm::BatchAAResults::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 647 of file AliasAnalysis.cpp.

References alias(), llvm::MemoryLocation::getBeforeOrAfter(), llvm::getUnderlyingObject(), I, llvm::isIdentifiedFunctionLocal(), llvm::ModRef, llvm::AliasResult::NoAlias, llvm::NoModRef, llvm::Object, llvm::PointerMayBeCapturedBefore(), 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 515 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 703 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 530 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 713 of file AliasAnalysis.cpp.

References assert(), E, llvm::ilist_node_impl< OptionsT >::getIterator(), getModRefInfo(), llvm::Instruction::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 545 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 433 of file AliasAnalysis.h.

References llvm::MemoryEffects::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 448 of file AliasAnalysis.h.

References llvm::MemoryEffects::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 170 of file AliasAnalysis.cpp.

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

Referenced by llvm::BatchAAResults::getArgModRefInfo(), and getModRefInfo().

◆ getMemoryEffects() [1/3]

MemoryEffects AAResults::getMemoryEffects ( const CallBase Call)

◆ getMemoryEffects() [2/3]

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

Definition at line 372 of file AliasAnalysis.cpp.

References llvm::MemoryEffects::unknown().

◆ getMemoryEffects() [3/3]

MemoryEffects AAResults::getMemoryEffects ( const Function F)

Return the behavior when calling the given function.

Definition at line 392 of file AliasAnalysis.cpp.

References F, and llvm::MemoryEffects::unknown().

◆ getModRefInfo() [1/15]

ModRefInfo AAResults::getModRefInfo ( const AtomicCmpXchgInst CX,
const MemoryLocation Loc,
AAQueryInfo AAQI 
)

◆ getModRefInfo() [2/15]

ModRefInfo AAResults::getModRefInfo ( const AtomicRMWInst RMW,
const MemoryLocation Loc,
AAQueryInfo AAQI 
)

◆ getModRefInfo() [3/15]

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

◆ getModRefInfo() [4/15]

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

◆ getModRefInfo() [5/15]

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

Definition at line 540 of file AliasAnalysis.cpp.

References getModRefInfoMask(), llvm::ModRef, and llvm::MemoryLocation::Ptr.

◆ getModRefInfo() [6/15]

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

Definition at line 553 of file AliasAnalysis.cpp.

References getModRefInfoMask(), llvm::ModRef, and llvm::MemoryLocation::Ptr.

◆ getModRefInfo() [7/15]

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

Definition at line 510 of file AliasAnalysis.cpp.

References getModRefInfoMask(), llvm::ModRef, and llvm::MemoryLocation::Ptr.

◆ getModRefInfo() [8/15]

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

References getModRefInfo(), and I.

◆ getModRefInfo() [9/15]

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

◆ getModRefInfo() [10/15]

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

References getModRefInfo(), and I.

Referenced by canInstructionRangeModRef(), canMoveAboveCall(), llvm::canSinkOrHoistInst(), llvm::FindAvailableLoadedValue(), llvm::findAvailablePtrLoadStore(), findSafeStoreForStoreStrongContraction(), foldLoadsRecursive(), getModRefInfo(), llvm::BatchAAResults::getModRefInfo(), llvm::hasPartialIVCondition(), isMemModifiedBetween(), isSafeToMove(), and mayLoopAccessLocation().

◆ getModRefInfo() [11/15]

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

◆ getModRefInfo() [12/15]

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

A convenience wrapper for constructing the memory location.

Definition at line 495 of file AliasAnalysis.h.

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

◆ getModRefInfo() [13/15]

ModRefInfo AAResults::getModRefInfo ( const LoadInst L,
const MemoryLocation Loc,
AAQueryInfo AAQI 
)

◆ getModRefInfo() [14/15]

ModRefInfo AAResults::getModRefInfo ( const StoreInst S,
const MemoryLocation Loc,
AAQueryInfo AAQI 
)

◆ getModRefInfo() [15/15]

ModRefInfo AAResults::getModRefInfo ( const VAArgInst V,
const MemoryLocation Loc,
AAQueryInfo AAQI 
)

◆ getModRefInfoMask() [1/3]

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

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

References getModRefInfoMask().

Referenced by llvm::canSinkOrHoistInst(), checkFunctionMemoryAccess(), getModRefInfo(), llvm::BatchAAResults::getModRefInfoMask(), getModRefInfoMask(), isOnlyCopiedFromConstantMemory(), pointsToConstantMemory(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), llvm::InstCombinerImpl::SimplifyAnyMemTransfer(), and llvm::InstCombinerImpl::visitStoreInst().

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

References F, 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 366 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 371 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 348 of file AliasAnalysis.h.

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

Referenced by llvm::GISelAddressing::instMayAlias(), isNoAlias(), llvm::AMDGPU::isReallyAClobber(), MemOperandsHaveAlias(), operandReferences(), and underlyingObjectsAlias().

◆ 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 359 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 353 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 461 of file AliasAnalysis.h.

References getMemoryEffects(), and llvm::MemoryEffects::onlyReadsMemory().

Referenced by llvm::MemoryDependenceResults::getDependency(), and llvm::MemoryDependenceResults::getNonLocalCallDependency().

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

References F, getMemoryEffects(), and llvm::MemoryEffects::onlyReadsMemory().

◆ pointsToConstantMemory() [1/3]

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

◆ pointsToConstantMemory() [2/3]

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

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

Referenced by getMemcpyLoadsAndStores(), llvm::objcarc::IsPotentialRetainableObjPtr(), llvm::BatchAAResults::pointsToConstantMemory(), and pointsToConstantMemory().

◆ pointsToConstantMemory() [3/3]

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

A convenience wrapper around the primary pointsToConstantMemory interface.

Definition at line 384 of file AliasAnalysis.h.

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

Friends And Related Function Documentation

◆ AAResultBase

friend class AAResultBase
friend

Definition at line 595 of file AliasAnalysis.h.

◆ BatchAAResults

friend class BatchAAResults
friend

Definition at line 603 of file AliasAnalysis.h.


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