LLVM 24.0.0git
SLPMemoryUtils.cpp File Reference
#include "SLPMemoryUtils.h"
#include "SLPCompatibilityAnalysis.h"
#include "SLPCostAnalysis.h"
#include "SLPTypeUtils.h"
#include "SLPUtils.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/Loads.h"
#include "llvm/Analysis/LoopAccessAnalysis.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/InstructionCost.h"
#include <algorithm>
#include <limits>
#include <optional>
#include <set>
#include <tuple>
#include <utility>

Go to the source code of this file.

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.
template<typename T>
Align llvm::slpvectorizer::computeCommonAlignment (ArrayRef< Value * > VL)
 Calculates minimal alignment as a common alignment.
template Align llvm::slpvectorizer::computeCommonAlignment< LoadInst > (ArrayRef< Value * >)
template Align llvm::slpvectorizer::computeCommonAlignment< StoreInst > (ArrayRef< Value * >)
const SCEVllvm::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.
static bool llvm::slpvectorizer::buildCompressMask (ArrayRef< Value * > PointerOps, ArrayRef< unsigned > Order, Type *ScalarTy, const DataLayout &DL, ScalarEvolution &SE, SmallVectorImpl< int > &CompressMask)
 Builds compress-like mask for shuffles for the given PointerOps, ordered with Order.
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)
 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)
 Checks if the VL can be transformed to a (masked)load + compress or (masked) interleaved 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)
 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)
 Clusters VL pointers by (basic block, underlying object) pair and sorts each cluster by offset.