[llvm] [LV] Improve cost model for some replicating recipes (PR #192056)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 03:46:51 PDT 2026


================
@@ -1828,7 +1828,8 @@ VPCostContext::getOperandInfo(VPValue *V) const {
 
 InstructionCost VPCostContext::getScalarizationOverhead(
     Type *ResultTy, ArrayRef<const VPValue *> Operands, ElementCount VF,
-    TTI::VectorInstrContext VIC, bool AlwaysIncludeReplicatingR) {
+    const VPSingleDefRecipe *R, TTI::VectorInstrContext VIC,
+    bool AlwaysIncludeReplicatingR) {
----------------
lukel97 wrote:

Not necessarily needed for this PR, but it seems like this could be split out into `getResultScalarizationOverhead` and `getOperandScalarizationOverhead`.

That way we could just check the users in `computeCost` and decide not to call `getResultScalarizationOverhead`, rather than having to plumb through the recipe

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


More information about the llvm-commits mailing list