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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 04:54:24 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);
----------------
lukel97 wrote:

VectorInstrContext isn't RISC-V or target specific. It's very hard to justify adding a new TTI function for a single ternary operator used in one line. 

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


More information about the llvm-commits mailing list