LLVM 24.0.0git
llvm::slpvectorizer::SLPAnalysisCache Class Reference

Caches the results of the expensive analyses that are queried repeatedly for the same values while the vectorization trees are built and their costs are estimated. More...

#include "Transforms/Vectorize/SLPVectorizer/SLPMemoryUtils.h"

Public Member Functions

std::optional< int64_t > getPointersDiff (Type *ElemTyA, Value *PtrA, Type *ElemTyB, Value *PtrB, const DataLayout &DL, ScalarEvolution &SE, bool StrictCheck=false, bool CheckType=true)
 Cached llvm::getPointersDiff(), a miss may require SCEV analysis.
bool sortPtrAccesses (ArrayRef< Value * > VL, Type *ElemTy, const DataLayout &DL, ScalarEvolution &SE, SmallVectorImpl< unsigned > &SortedIndices)
 llvm::sortPtrAccesses() with the cached pointer distances.
bool isGuaranteedNotToBePoison (const Value *V, AssumptionCache *AC)
 Cached llvm::isGuaranteedNotToBePoison().
void clear ()

Detailed Description

Caches the results of the expensive analyses that are queried repeatedly for the same values while the vectorization trees are built and their costs are estimated.

The results may change once new code replaces the scalars, so the cache is cleared each time the replaced scalars are erased.

Definition at line 49 of file SLPMemoryUtils.h.

Member Function Documentation

◆ clear()

void llvm::slpvectorizer::SLPAnalysisCache::clear ( )
inline

Definition at line 67 of file SLPMemoryUtils.h.

◆ getPointersDiff()

std::optional< int64_t > llvm::slpvectorizer::SLPAnalysisCache::getPointersDiff ( Type * ElemTyA,
Value * PtrA,
Type * ElemTyB,
Value * PtrB,
const DataLayout & DL,
ScalarEvolution & SE,
bool StrictCheck = false,
bool CheckType = true )

Cached llvm::getPointersDiff(), a miss may require SCEV analysis.

The result for (PtrA, PtrB) also serves the query for the swapped pointers.

Definition at line 199 of file SLPMemoryUtils.cpp.

References DL, llvm::getPointersDiff(), and llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key.

Referenced by sortPtrAccesses().

◆ isGuaranteedNotToBePoison()

bool llvm::slpvectorizer::SLPAnalysisCache::isGuaranteedNotToBePoison ( const Value * V,
AssumptionCache * AC )

◆ sortPtrAccesses()

bool llvm::slpvectorizer::SLPAnalysisCache::sortPtrAccesses ( ArrayRef< Value * > VL,
Type * ElemTy,
const DataLayout & DL,
ScalarEvolution & SE,
SmallVectorImpl< unsigned > & SortedIndices )

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