LLVM  16.0.0git
Classes | Public Member Functions | List of all members
llvm::BasicAAResult Class Reference

This is the AA result object for the basic, local, and stateless alias analysis. More...

#include "llvm/Analysis/BasicAliasAnalysis.h"

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

Classes

struct  DecomposedGEP
 

Public Member Functions

 BasicAAResult (const DataLayout &DL, const Function &F, const TargetLibraryInfo &TLI, AssumptionCache &AC, DominatorTree *DT=nullptr, PhiValues *PV=nullptr)
 
 BasicAAResult (const BasicAAResult &Arg)
 
 BasicAAResult (BasicAAResult &&Arg)
 
bool invalidate (Function &Fn, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
 Handle invalidation events in the new pass manager. More...
 
AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 Checks to see if the specified callsite can clobber the specified memory object. More...
 
ModRefInfo getModRefInfo (const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfoMask (const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals=false)
 Returns a bitmask that should be unconditionally applied to the ModRef info of a memory location. More...
 
ModRefInfo getArgModRefInfo (const CallBase *Call, unsigned ArgIdx)
 Get the location associated with a pointer argument of a callsite. More...
 
MemoryEffects getMemoryEffects (const CallBase *Call, AAQueryInfo &AAQI)
 Returns the behavior when calling the given call site. More...
 
MemoryEffects getMemoryEffects (const Function *Fn)
 Returns the behavior when calling the given function. More...
 
- Public Member Functions inherited from llvm::AAResultBase
AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfoMask (const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals)
 
ModRefInfo getArgModRefInfo (const CallBase *Call, unsigned ArgIdx)
 
MemoryEffects getMemoryEffects (const CallBase *Call, AAQueryInfo &AAQI)
 
MemoryEffects getMemoryEffects (const Function *F)
 
ModRefInfo getModRefInfo (const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
 
ModRefInfo getModRefInfo (const CallBase *Call1, const CallBase *Call2, AAQueryInfo &AAQI)
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::AAResultBase
 AAResultBase ()=default
 
 AAResultBase (const AAResultBase &Arg)
 
 AAResultBase (AAResultBase &&Arg)
 

Detailed Description

This is the AA result object for the basic, local, and stateless alias analysis.

It implements the AA query interface in an entirely stateless manner. As one consequence, it is never invalidated due to IR changes. While it does retain some storage, that is used as an optimization and not to preserve information from query to query. However it does retain handles to various other analyses and must be recomputed when those analyses are.

Definition at line 44 of file BasicAliasAnalysis.h.

Constructor & Destructor Documentation

◆ BasicAAResult() [1/3]

llvm::BasicAAResult::BasicAAResult ( const DataLayout DL,
const Function F,
const TargetLibraryInfo TLI,
AssumptionCache AC,
DominatorTree DT = nullptr,
PhiValues PV = nullptr 
)
inline

Definition at line 53 of file BasicAliasAnalysis.h.

References DL, and F.

◆ BasicAAResult() [2/3]

llvm::BasicAAResult::BasicAAResult ( const BasicAAResult Arg)
inline

Definition at line 58 of file BasicAliasAnalysis.h.

References DL, and F.

◆ BasicAAResult() [3/3]

llvm::BasicAAResult::BasicAAResult ( BasicAAResult &&  Arg)
inline

Definition at line 61 of file BasicAliasAnalysis.h.

References DL, and F.

Member Function Documentation

◆ alias()

AliasResult BasicAAResult::alias ( const MemoryLocation LocA,
const MemoryLocation LocB,
AAQueryInfo AAQI 
)

◆ getArgModRefInfo()

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

Get the location associated with a pointer argument of a callsite.

Definition at line 790 of file BasicAliasAnalysis.cpp.

References llvm::AAResultBase::getArgModRefInfo(), llvm::Mod, llvm::NoModRef, and llvm::Ref.

◆ getMemoryEffects() [1/2]

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

Returns the behavior when calling the given call site.

Definition at line 757 of file BasicAliasAnalysis.cpp.

References llvm::AAQueryInfo::AAR, llvm::AAResults::getMemoryEffects(), llvm::MemoryEffects::readOnly(), and llvm::MemoryEffects::writeOnly().

Referenced by getModRefInfo().

◆ getMemoryEffects() [2/2]

MemoryEffects BasicAAResult::getMemoryEffects ( const Function F)

Returns the behavior when calling the given function.

For use when the call site is not known.

Definition at line 777 of file BasicAliasAnalysis.cpp.

References F, llvm::MemoryEffects::inaccessibleMemOnly(), llvm::ModRef, and llvm::MemoryEffects::readOnly().

◆ getModRefInfo() [1/2]

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

Checks to see if the specified callsite can clobber the specified memory object.

Since we only look at local properties of this function, we really can't say much about this query. We do, however, use simple "address taken" analysis on local objects.

Definition at line 841 of file BasicAliasAnalysis.cpp.

References llvm::AAQueryInfo::AAR, llvm::AAResults::alias(), assert(), llvm::AAQueryInfo::CI, llvm::MemoryLocation::getBeforeOrAfter(), llvm::AAResultBase::getModRefInfo(), llvm::getUnderlyingObject(), isIntrinsicCall(), llvm::isMallocOrCallocLikeFn(), llvm::isModAndRefSet(), llvm::CaptureInfo::isNotCapturedBeforeOrAt(), llvm::Mod, llvm::ModRef, llvm::AliasResult::NoAlias, llvm::NoModRef, notDifferentParent(), llvm::Object, llvm::MemoryLocation::Ptr, and llvm::Ref.

◆ getModRefInfo() [2/2]

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

◆ getModRefInfoMask()

ModRefInfo BasicAAResult::getModRefInfoMask ( const MemoryLocation Loc,
AAQueryInfo AAQI,
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 680 of file BasicAliasAnalysis.cpp.

References _, llvm::append_range(), Arg, assert(), llvm::AAResultBase::getModRefInfoMask(), llvm::getUnderlyingObject(), llvm::make_scope_exit(), llvm::NoModRef, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::MemoryLocation::Ptr, llvm::Ref, and SI.

◆ invalidate()

bool BasicAAResult::invalidate ( Function Fn,
const PreservedAnalyses PA,
FunctionAnalysisManager::Invalidator Inv 
)

Handle invalidation events in the new pass manager.

Definition at line 83 of file BasicAliasAnalysis.cpp.

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


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