[llvm] [VPlan] Compute cost of replicating calls in VPlan. (NFCI) (PR #154291)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 03:15:10 PDT 2025


================
@@ -3017,8 +3010,43 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
     SmallVector<Type *, 4> Tys;
     for (VPValue *ArgOp : drop_end(operands()))
       Tys.push_back(Ctx.Types.inferScalarType(ArgOp));
+
     Type *ResultTy = Ctx.Types.inferScalarType(this);
-    return Ctx.TTI.getCallInstrCost(CalledFn, ResultTy, Tys, Ctx.CostKind);
+    InstructionCost ScalarCallCost =
+        Ctx.TTI.getCallInstrCost(CalledFn, ResultTy, Tys, Ctx.CostKind);
----------------
fhahn wrote:

The current code does not handle intrinsics for now (see bail-out at line 3008).

The twist with intrinsics is that if we chose the intrinsic cost, we only create VPReplicateRecipe for various pseudo-intrinsics. I'll add support for intrinsics as follow-up

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


More information about the llvm-commits mailing list