LLVM 19.0.0git
|
Merges shuffle masks and emits final shuffle instruction, if required. More...
Public Member Functions | |
ShuffleCostEstimator (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 | 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, unsigned VF=0, function_ref< void(Value *&, SmallVectorImpl< 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 7862 of file SLPVectorizer.cpp.
|
inline |
Definition at line 8437 of file SLPVectorizer.cpp.
|
inline |
Definition at line 8712 of file SLPVectorizer.cpp.
References assert(), and llvm::SmallVectorBase< Size_T >::empty().
|
inline |
Definition at line 8570 of file SLPVectorizer.cpp.
References assert(), llvm::SmallVectorImpl< T >::assign(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorBase< Size_T >::empty(), llvm::find_if(), llvm::FixedVectorType::get(), llvm::TargetTransformInfo::getNumberOfParts(), Idx, llvm::PoisonMaskElem, and llvm::SmallVectorBase< Size_T >::size().
|
inline |
Definition at line 8543 of file SLPVectorizer.cpp.
References llvm::all_of(), assert(), llvm::SmallVectorImpl< T >::assign(), llvm::SmallVectorBase< Size_T >::empty(), llvm::find_if(), llvm::FixedVectorType::get(), llvm::TargetTransformInfo::getNumberOfParts(), Idx, and llvm::PoisonMaskElem.
|
inline |
Adds another one input vector and the mask for the shuffling.
Definition at line 8609 of file SLPVectorizer.cpp.
References llvm::all_of(), assert(), llvm::SmallVectorImpl< T >::assign(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::SmallVectorBase< Size_T >::empty(), llvm::enumerate(), llvm::SmallVectorTemplateCommon< T, typename >::front(), llvm::Value::getType(), Idx, if(), P, llvm::PoisonMaskElem, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
|
inline |
Adds 2 input vectors and the mask for their shuffling.
Definition at line 8591 of file SLPVectorizer.cpp.
References llvm::all_of(), assert(), llvm::enumerate(), llvm::SmallVectorTemplateCommon< T, typename >::front(), P, llvm::PoisonMaskElem, and llvm::SmallVectorBase< Size_T >::size().
|
inline |
Definition at line 8442 of file SLPVectorizer.cpp.
References llvm::any_of(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::take_front().
|
inline |
Definition at line 8680 of file SLPVectorizer.cpp.
|
inline |
Finalize emission of the shuffles.
Definition at line 8683 of file SLPVectorizer.cpp.
|
inline |
Definition at line 8657 of file SLPVectorizer.cpp.
References llvm::ArrayRef< T >::front(), llvm::ConstantVector::get(), llvm::ElementCount::getFixed(), llvm::Constant::getNullValue(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::take_front().
|
inline |
Checks if the specified entry E
needs to be delayed because of its dependency nodes.
Definition at line 8538 of file SLPVectorizer.cpp.