[llvm] [VPlan] Move call widening decision to VPlan. (NFCI) (PR #195518)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 02:37:47 PDT 2026


================
@@ -3634,6 +3609,39 @@ InstructionCost VPReplicateRecipe::computeCost(ElementCount VF,
   return Ctx.getLegacyCost(UI, VF);
 }
 
+InstructionCost VPReplicateRecipe::computeScalarCallCost(
+    Function *CalledFn, Type *ResultTy, ArrayRef<const VPValue *> ArgOps,
+    bool IsSingleScalar, ElementCount VF, VPCostContext &Ctx) {
+  SmallVector<Type *, 4> Tys = map_to_vector<4>(
+      ArgOps, [&](const VPValue *Op) { return Ctx.Types.inferScalarType(Op); });
+
+  Intrinsic::ID IntrinID = CalledFn->getIntrinsicID();
+  auto GetIntrinsicCost = [&] {
+    return Ctx.TTI.getIntrinsicInstrCost(
+        IntrinsicCostAttributes(IntrinID, ResultTy, Tys), Ctx.CostKind);
+  };
----------------
fhahn wrote:

updated to return invalid cost in that case, thanks

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


More information about the llvm-commits mailing list