LLVM 24.0.0git
SLPMemoryUtils.h File Reference
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Support/Alignment.h"
#include <cstdint>
#include <optional>
#include <tuple>

Go to the source code of this file.

Classes

class  llvm::slpvectorizer::SLPAnalysisCache
 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...

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::slpvectorizer
 A private "module" namespace for types and utilities used by this pass.

Functions

bool llvm::slpvectorizer::arePointersCompatible (Value *Ptr1, Value *Ptr2, const TargetLibraryInfo &TLI, unsigned MaxDepth, bool CompareOpcodes=true)
 MaxDepth is the recursion limit for getUnderlyingObject.
ConstantInt * llvm::slpvectorizer::getStrideBytesIfConstant (Value *Stride, Type *ScalarTy, const DataLayout &DL, bool IsReverse=false)
 Returns Stride scaled by the allocation size of ScalarTy, negated if IsReverse is set, or nullptr if Stride is not a constant.
Value * llvm::slpvectorizer::createWidenedStridedCast (IRBuilderBase &Builder, Value *V, Type *DstTy, const DataLayout &DL)
 Casts V between the widened strided access type and the entry vector type DstTy.
template<typename T>
Align llvm::slpvectorizer::computeCommonAlignment (ArrayRef< Value * > VL)
 Calculates minimal alignment as a common alignment.
const SCEV * llvm::slpvectorizer::calculateRtStride (ArrayRef< Value * > PointerOps, Type *ElemTy, const DataLayout &DL, ScalarEvolution &SE, SmallVectorImpl< unsigned > &SortedIndices)
 Checks if the provided list of pointers Pointers represents the strided pointers for type ElemTy.
bool llvm::slpvectorizer::isMaskedLoadCompress (ArrayRef< Value * > VL, ArrayRef< Value * > PointerOps, ArrayRef< unsigned > Order, const TargetTransformInfo &TTI, const DataLayout &DL, ScalarEvolution &SE, AssumptionCache &AC, const DominatorTree &DT, const TargetLibraryInfo &TLI, const TargetTransformInfo::TargetCostKind CostKind, const function_ref< bool(Value *)> AreAllUsersVectorized, bool ReVec, bool &IsMasked, unsigned &InterleaveFactor, SmallVectorImpl< int > &CompressMask, VectorType *&LoadVecTy, SLPAnalysisCache &Cache)
 Checks if the VL can be transformed to a (masked)load + compress or (masked) interleaved load.
bool llvm::slpvectorizer::isMaskedLoadCompress (ArrayRef< Value * > VL, ArrayRef< Value * > PointerOps, ArrayRef< unsigned > Order, const TargetTransformInfo &TTI, const DataLayout &DL, ScalarEvolution &SE, AssumptionCache &AC, const DominatorTree &DT, const TargetLibraryInfo &TLI, const TargetTransformInfo::TargetCostKind CostKind, const function_ref< bool(Value *)> AreAllUsersVectorized, bool ReVec, SLPAnalysisCache &Cache)
 Checks if the VL can be transformed to a (masked)load + compress or (masked) interleaved load.
bool llvm::slpvectorizer::canWidenLoadsOverUndefLanes (ArrayRef< Value * > VL, const DataLayout &DL, ScalarEvolution &SE, AssumptionCache &AC, const DominatorTree &DT, const TargetLibraryInfo &TLI)
 Checks if the simple loads of VL, mixed with the undef and poison lanes, can be replaced by a single load of the whole VL width.
uint64_t llvm::slpvectorizer::getVectorLoadShift (ArrayRef< Value * > Scalars)
 Returns the distance in bytes from the start of the vector load to the first load of Scalars: the leading undef lanes are covered by the vector load.
bool llvm::slpvectorizer::isMaskedStoreCompress (ArrayRef< Value * > VL, ArrayRef< Value * > PointerOps, ArrayRef< unsigned > Order, const TargetTransformInfo &TTI, const DataLayout &DL, ScalarEvolution &SE, Align CommonAlignment, SmallVectorImpl< int > &ReuseShuffleIndices, FixedVectorType *&StoreVecTy, SLPAnalysisCache &Cache)
 Checks if the stores VL with pointers PointerOps can be lowered as a single masked store.
bool llvm::slpvectorizer::clusterSortPtrAccesses (ArrayRef< Value * > VL, ArrayRef< BasicBlock * > BBs, Type *ElemTy, const DataLayout &DL, ScalarEvolution &SE, unsigned MaxDepth, SmallVectorImpl< unsigned > &SortedIndices, SLPAnalysisCache &Cache)
 Clusters VL pointers by (basic block, underlying object) pair and sorts each cluster by offset.