LLVM: llvm::LoopAccessInfo Class Reference (original) (raw)

Drive the analysis of memory accesses in the loop. More...

#include "[llvm/Analysis/LoopAccessAnalysis.h](LoopAccessAnalysis%5F8h%5Fsource.html)"

Public Member Functions
LLVM_ABI LoopAccessInfo (Loop *L, ScalarEvolution *SE, const TargetTransformInfo *TTI, const TargetLibraryInfo *TLI, AAResults *AA, DominatorTree *DT, LoopInfo *LI, AssumptionCache *AC, bool AllowPartial=false)
bool canVectorizeMemory () const
Return true we can analyze the memory accesses in the loop and there are no memory dependence cycles.
bool hasConvergentOp () const
Return true if there is a convergent operation in the loop.
bool hasAllowPartial () const
Return true if, when runtime pointer checking does not have complete results, it instead has partial results for those memory accesses that could be analyzed.
const RuntimePointerChecking * getRuntimePointerChecking () const
unsigned getNumRuntimePointerChecks () const
Number of memchecks required to prove independence of otherwise may-alias pointers.
LLVM_ABI bool isInvariant (Value *V) const
Returns true if value V is loop invariant.
unsigned getNumStores () const
unsigned getNumLoads () const
const OptimizationRemarkAnalysis * getReport () const
The diagnostics report generated for the analysis.
const MemoryDepChecker & getDepChecker () const
the Memory Dependence Checker which can determine the loop-independent and loop-carried dependences between memory accesses.
SmallVector< Instruction *, 4 > getInstructionsForAccess (Value *Ptr, bool isWrite) const
Return the list of instructions that use Ptr to read or write memory.
const DenseMap< Value *, const SCEV * > & getSymbolicStrides () const
If an access has a symbolic strides, this maps the pointer value to the stride symbol.
LLVM_ABI void print (raw_ostream &OS, unsigned Depth=0) const
Print the information about the memory accesses in the loop.
bool hasStoreStoreDependenceInvolvingLoopInvariantAddress () const
Return true if the loop has memory dependence involving two stores to an invariant address, else return false.
bool hasLoadStoreDependenceInvolvingLoopInvariantAddress () const
Return true if the loop has memory dependence involving a load and a store to an invariant address, else return false.
ArrayRef< StoreInst * > getStoresToInvariantAddresses () const
Return the list of stores to invariant addresses.
const PredicatedScalarEvolution & getPSE () const
Used to add runtime SCEV checks.

Drive the analysis of memory accesses in the loop.

This class is responsible for analyzing the memory accesses of a loop. It collects the accesses and then its main helper the AccessAnalysis class finds and categorizes the dependences in buildDependenceSets.

For memory dependences that can be analyzed at compile time, it determines whether the dependence is part of cycle inhibiting vectorization. This work is delegated to the MemoryDepChecker class.

For memory dependences that cannot be determined at compile time, it generates run-time checks to prove independence. This is done by AccessAnalysis::canCheckPtrAtRT and the checks are maintained by the RuntimePointerCheck class. AllowPartial determines whether partial checks are generated when not all pointers could be analyzed.

If pointers can wrap or can't be expressed as affine AddRec expressions by ScalarEvolution, we will generate run-time checks by emitting a SCEVUnionPredicate.

Checks for both memory dependences and the SCEV predicates contained in the PSE must be emitted in order for the results of this analysis to be valid.

Definition at line 689 of file LoopAccessAnalysis.h.

blockNeedsPredication()

canVectorizeMemory()

bool llvm::LoopAccessInfo::canVectorizeMemory ( ) const inline

Return true we can analyze the memory accesses in the loop and there are no memory dependence cycles.

Note that for dependences between loads & stores with uniform addresses, hasStoreStoreDependenceInvolvingLoopInvariantAddress and hasLoadStoreDependenceInvolvingLoopInvariantAddress also need to be checked.

Definition at line 703 of file LoopAccessAnalysis.h.

getDepChecker()

getInstructionsForAccess()

Return the list of instructions that use Ptr to read or write memory.

Definition at line 747 of file LoopAccessAnalysis.h.

getNumLoads()

unsigned llvm::LoopAccessInfo::getNumLoads ( ) const inline

getNumRuntimePointerChecks()

unsigned llvm::LoopAccessInfo::getNumRuntimePointerChecks ( ) const inline

Number of memchecks required to prove independence of otherwise may-alias pointers.

Definition at line 721 of file LoopAccessAnalysis.h.

getNumStores()

unsigned llvm::LoopAccessInfo::getNumStores ( ) const inline

getPSE()

Used to add runtime SCEV checks.

Simplifies SCEV expressions and converts them to a more usable form. All SCEV expressions during the analysis should be re-written (and therefore simplified) according to PSE. A user of LoopAccessAnalysis will need to emit the runtime checks associated with this predicate.

Definition at line 783 of file LoopAccessAnalysis.h.

Referenced by canTailPredicateLoop().

getReport()

The diagnostics report generated for the analysis.

E.g. why we couldn't analyze the loop.

Definition at line 739 of file LoopAccessAnalysis.h.

getRuntimePointerChecking()

getStoresToInvariantAddresses()

ArrayRef< StoreInst * > llvm::LoopAccessInfo::getStoresToInvariantAddresses ( ) const inline

getSymbolicStrides()

If an access has a symbolic strides, this maps the pointer value to the stride symbol.

Definition at line 754 of file LoopAccessAnalysis.h.

hasAllowPartial()

bool llvm::LoopAccessInfo::hasAllowPartial ( ) const inline

Return true if, when runtime pointer checking does not have complete results, it instead has partial results for those memory accesses that could be analyzed.

Definition at line 713 of file LoopAccessAnalysis.h.

hasConvergentOp()

bool llvm::LoopAccessInfo::hasConvergentOp ( ) const inline

Return true if there is a convergent operation in the loop.

There may still be reported runtime pointer checks that would be required, but it is not legal to insert them.

Definition at line 708 of file LoopAccessAnalysis.h.

hasLoadStoreDependenceInvolvingLoopInvariantAddress()

bool llvm::LoopAccessInfo::hasLoadStoreDependenceInvolvingLoopInvariantAddress ( ) const inline

Return true if the loop has memory dependence involving a load and a store to an invariant address, else return false.

Definition at line 769 of file LoopAccessAnalysis.h.

hasStoreStoreDependenceInvolvingLoopInvariantAddress()

bool llvm::LoopAccessInfo::hasStoreStoreDependenceInvolvingLoopInvariantAddress ( ) const inline

Return true if the loop has memory dependence involving two stores to an invariant address, else return false.

Definition at line 763 of file LoopAccessAnalysis.h.

isInvariant()

bool LoopAccessInfo::isInvariant ( Value * V ) const

print()


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