[llvm] [LV] Fix the cost of first order recurrence splice (PR #192473)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 08:51:32 PDT 2026


================
@@ -1229,14 +1218,11 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
   }
   case VPInstruction::FirstOrderRecurrenceSplice: {
     assert(VF.isVector() && "Scalar FirstOrderRecurrenceSplice?");
-    SmallVector<int> Mask(VF.getKnownMinValue());
-    std::iota(Mask.begin(), Mask.end(), VF.getKnownMinValue() - 1);
     Type *VectorTy = toVectorTy(Ctx.Types.inferScalarType(this), VF);
-
     return Ctx.TTI.getShuffleCost(TargetTransformInfo::SK_Splice,
                                   cast<VectorType>(VectorTy),
-                                  cast<VectorType>(VectorTy), Mask,
-                                  Ctx.CostKind, VF.getKnownMinValue() - 1);
+                                  cast<VectorType>(VectorTy), {}, Ctx.CostKind,
+                                  -(VF.getKnownMinValue() - 1));
----------------
lukel97 wrote:

I think this should just be -1? That would match what BasicTTIImpl.h passes in for the vector.splice.right intrinsic

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


More information about the llvm-commits mailing list