LLVM: slpvectorizer::BoUpSLP::ShuffleCostEstimator Class Reference (original) (raw)

Merges shuffle masks and emits final shuffle instruction, if required. More...

Public Member Functions
ShuffleCostEstimator (Type *ScalarTy, TargetTransformInfo &TTI, ArrayRef< Value * > VectorizedVals, BoUpSLP &R, SmallPtrSetImpl< Value * > &CheckedExtracts)
Value * adjustExtracts (const TreeEntry *E, MutableArrayRef< int > Mask, ArrayRef< std::optional< TTI::ShuffleKind > > ShuffleKinds, unsigned NumParts, bool &UseVecBaseAsInput)
std::optional< InstructionCost > needToDelay (const TreeEntry *, ArrayRef< SmallVector< const TreeEntry * > >) const
Checks if the specified entry E needs to be delayed because of its dependency nodes.
void resetForSameNode ()
Reset the builder to handle perfect diamond match.
void add (const TreeEntry &E1, const TreeEntry &E2, ArrayRef< int > Mask)
void add (const TreeEntry &E1, ArrayRef< int > Mask)
void add (Value *V1, Value *V2, ArrayRef< int > Mask)
Adds 2 input vectors and the mask for their shuffling.
void add (Value *V1, ArrayRef< int > Mask, bool ForExtracts=false)
Adds another one input vector and the mask for the shuffling.
Value * gather (ArrayRef< Value * > VL, unsigned MaskVF=0, Value *Root=nullptr)
InstructionCost createFreeze (InstructionCost Cost)
InstructionCost finalize (ArrayRef< int > ExtMask, ArrayRef< std::pair< const TreeEntry *, unsigned > > SubVectors, ArrayRef< int > SubVectorsMask, unsigned VF=0, function_ref< void(Value *&, SmallVectorImpl< int > &, function_ref< Value *(Value *, Value *, ArrayRef< int >)>)> Action={})
Finalize emission of the shuffles.
~ShuffleCostEstimator ()

Merges shuffle masks and emits final shuffle instruction, if required.

It supports shuffling of 2 input vectors. It implements lazy shuffles emission, when the actual shuffle instruction is generated only if this is actually required. Otherwise, the shuffle instruction emission is delayed till the end of the process, to reduce the number of emitted instructions and further analysis/transformations.

Definition at line 13521 of file SLPVectorizer.cpp.

~ShuffleCostEstimator()

slpvectorizer::BoUpSLP::ShuffleCostEstimator::~ShuffleCostEstimator ( ) inline

add() [1/4]

void slpvectorizer::BoUpSLP::ShuffleCostEstimator::add ( const TreeEntry & E1, ArrayRef< int > Mask ) inline

add() [2/4]

void slpvectorizer::BoUpSLP::ShuffleCostEstimator::add ( const TreeEntry & E1, const TreeEntry & E2, ArrayRef< int > Mask ) inline

add() [3/4]

void slpvectorizer::BoUpSLP::ShuffleCostEstimator::add ( Value * V1, ArrayRef< int > Mask, bool ForExtracts = false ) inline

add() [4/4]

void slpvectorizer::BoUpSLP::ShuffleCostEstimator::add ( Value * V1, Value * V2, ArrayRef< int > Mask ) inline

adjustExtracts()

createFreeze()

finalize()

gather()

Definition at line 14294 of file SLPVectorizer.cpp.

References assert(), llvm::cast(), llvm::dyn_cast(), llvm::ArrayRef< T >::front(), llvm::ConstantVector::get(), llvm::PoisonValue::get(), llvm::UndefValue::get(), llvm::ElementCount::getFixed(), llvm::Constant::getNullValue(), llvm::Type::getScalarType(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), llvm::isa(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), replicateMask(), llvm::ArrayRef< T >::size(), SLPReVec, and llvm::ArrayRef< T >::take_front().

needToDelay()

Checks if the specified entry E needs to be delayed because of its dependency nodes.

Definition at line 14174 of file SLPVectorizer.cpp.

resetForSameNode()

void slpvectorizer::BoUpSLP::ShuffleCostEstimator::resetForSameNode ( ) inline

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