[llvm] [SLP] More accurately cost RISCV scalar splats (PR #213104)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 04:30:55 PDT 2026


================
@@ -14948,8 +14979,11 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
         Constant::getNullValue(getWidenedType(ScalarTy, CommonMask.size()));
     if (InVectors.size() == 2)
       InVectors.pop_back();
-    return ExtraCost + BaseShuffleAnalysis::createShuffle<InstructionCost>(
-                           V1, V2, CommonMask, Builder, ScalarTy, SLPReVec, VL);
+    TTI::VectorInstrContext Ctx =
+        P2.isNull() ? Ctx1 : TTI::combineVectorInstrContexts(Ctx1, Ctx2);
----------------
alexey-bataev wrote:

No, again, SLP should not know anything about this, this purely TI, since this feature is not SLP-related, but RISC-V related

https://github.com/llvm/llvm-project/pull/213104


More information about the llvm-commits mailing list