LLVM  6.0.0svn
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]

Public Member Functions

 BasicAAResult (const DataLayout &DL, const TargetLibraryInfo &TLI, AssumptionCache &AC, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr)
 
 BasicAAResult (const BasicAAResult &Arg)
 
 BasicAAResult (BasicAAResult &&Arg)
 
bool invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
 Handle invalidation events in the new pass manager. More...
 
AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 
ModRefInfo getModRefInfo (ImmutableCallSite CS, const MemoryLocation &Loc)
 Checks to see if the specified callsite can clobber the specified memory object. More...
 
ModRefInfo getModRefInfo (ImmutableCallSite CS1, ImmutableCallSite CS2)
 
bool pointsToConstantMemory (const MemoryLocation &Loc, bool OrLocal)
 Chases pointers until we find a (constant global) or not. More...
 
ModRefInfo getArgModRefInfo (ImmutableCallSite CS, unsigned ArgIdx)
 Get the location associated with a pointer argument of a callsite. More...
 
FunctionModRefBehavior getModRefBehavior (ImmutableCallSite CS)
 Returns the behavior when calling the given call site. More...
 
FunctionModRefBehavior getModRefBehavior (const Function *F)
 Returns the behavior when calling the given function. More...
 
- Public Member Functions inherited from llvm::AAResultBase< DerivedT >
AliasResult alias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 
bool pointsToConstantMemory (const MemoryLocation &Loc, bool OrLocal)
 
ModRefInfo getArgModRefInfo (ImmutableCallSite CS, unsigned ArgIdx)
 
FunctionModRefBehavior getModRefBehavior (ImmutableCallSite CS)
 
FunctionModRefBehavior getModRefBehavior (const Function *F)
 
ModRefInfo getModRefInfo (ImmutableCallSite CS, const MemoryLocation &Loc)
 
ModRefInfo getModRefInfo (ImmutableCallSite CS1, ImmutableCallSite CS2)
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::AAResultBase< DerivedT >
 AAResultBase ()=default
 
 AAResultBase (const AAResultBase &Arg)
 
 AAResultBase (AAResultBase &&Arg)
 
AAResultsProxy getBestAAResults ()
 Get a proxy for the best AA result set to query at this time. More...
 

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 54 of file BasicAliasAnalysis.h.

Constructor & Destructor Documentation

◆ BasicAAResult() [1/3]

llvm::BasicAAResult::BasicAAResult ( const DataLayout DL,
const TargetLibraryInfo TLI,
AssumptionCache AC,
DominatorTree DT = nullptr,
LoopInfo LI = nullptr 
)
inline

Definition at line 64 of file BasicAliasAnalysis.h.

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

◆ BasicAAResult() [2/3]

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

Definition at line 69 of file BasicAliasAnalysis.h.

◆ BasicAAResult() [3/3]

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

Member Function Documentation

◆ alias()

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

◆ getArgModRefInfo()

ModRefInfo BasicAAResult::getArgModRefInfo ( ImmutableCallSite  CS,
unsigned  ArgIdx 
)

◆ getModRefBehavior() [1/2]

FunctionModRefBehavior BasicAAResult::getModRefBehavior ( ImmutableCallSite  CS)

◆ getModRefBehavior() [2/2]

FunctionModRefBehavior BasicAAResult::getModRefBehavior ( const Function F)

◆ getModRefInfo() [1/2]

ModRefInfo BasicAAResult::getModRefInfo ( ImmutableCallSite  CS,
const MemoryLocation Loc 
)

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 754 of file BasicAliasAnalysis.cpp.

References alias(), llvm::AAResultBase< DerivedT >::AAResultsProxy::alias(), assert(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::data_operands_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::data_operands_end(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::doesNotAccessMemory(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::doesNotCapture(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::doesNotReadMemory(), llvm::AAResultBase< DerivedT >::getBestAAResults(), llvm::MemoryLocation::getForDest(), llvm::MemoryLocation::getForSource(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::AAResultBase< DerivedT >::getModRefInfo(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getNumArgOperands(), llvm::GetUnderlyingObject(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isByValArgument(), isIntrinsicCall(), llvm::isMallocOrCallocLikeFn(), isNonEscapingLocalObject(), llvm::MRI_Mod, llvm::MRI_ModRef, llvm::MRI_NoModRef, llvm::MRI_Ref, llvm::MustAlias, llvm::NoAlias, notDifferentParent(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::onlyReadsMemory(), and llvm::MemoryLocation::Ptr.

Referenced by BasicAAResult().

◆ getModRefInfo() [2/2]

ModRefInfo BasicAAResult::getModRefInfo ( ImmutableCallSite  CS1,
ImmutableCallSite  CS2 
)

◆ invalidate()

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

Handle invalidation events in the new pass manager.

Definition at line 88 of file BasicAliasAnalysis.cpp.

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

Referenced by BasicAAResult().

◆ pointsToConstantMemory()

bool BasicAAResult::pointsToConstantMemory ( const MemoryLocation Loc,
bool  OrLocal 
)

Chases pointers until we find a (constant global) or not.

Returns whether the given pointer value points to memory that is local to the function, with global constants being considered local to all functions.

Definition at line 544 of file BasicAliasAnalysis.cpp.

References assert(), llvm::SmallVectorBase::empty(), llvm::GetUnderlyingObject(), llvm::AAResultBase< DerivedT >::pointsToConstantMemory(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::MemoryLocation::Ptr, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and SI.

Referenced by BasicAAResult().


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