[llvm] [SLP] More accurately cost RISCV scalar splats (PR #213104)
Ryan Buchner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 31 01:17:54 PDT 2026
================
@@ -673,12 +673,14 @@ InstructionCost RISCVTTIImpl::getSlideCost(FixedVectorType *Tp,
return FirstSlideCost + SecondSlideCost + MaskCost;
}
-InstructionCost
-RISCVTTIImpl::getShuffleCost(TTI::ShuffleKind Kind, VectorType *DstTy,
- VectorType *SrcTy, ArrayRef<int> Mask,
- TTI::TargetCostKind CostKind, int Index,
- VectorType *SubTp, ArrayRef<const Value *> Args,
- const Instruction *CxtI) const {
+InstructionCost RISCVTTIImpl::getShuffleCost(
+ TTI::ShuffleKind Kind, VectorType *DstTy, VectorType *SrcTy,
+ ArrayRef<int> Mask, TTI::TargetCostKind CostKind, int Index,
+ VectorType *SubTp, ArrayRef<const Value *> Args, const Instruction *CxtI,
+ TTI::VectorInstrContext VIC) const {
+ if (VIC == TTI::VectorInstrContext::SplatOpFolded)
+ return TTI::TCC_Free;
----------------
bababuck wrote:
I had looked into that but deferred from it since `SplatOpFolded` should only be set in scenarios when `Kind == SK_Broadcast`. Could add as an assertion to confirm that.
https://github.com/llvm/llvm-project/pull/213104
More information about the llvm-commits
mailing list