[llvm] [VPlan] Consider address computation cost in VPInterleaveRecipe. (PR #148808)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 04:52:51 PDT 2025


================
@@ -3666,6 +3666,9 @@ InstructionCost VPInterleaveRecipe::computeCost(ElementCount VF,
       InsertPos->getOpcode(), WideVecTy, IG->getFactor(), Indices,
       IG->getAlign(), AS, Ctx.CostKind, getMask(), NeedsMaskForGaps);
 
+  // Add the address computation cost.
+  Cost += Ctx.TTI.getAddressComputationCost(WideVecTy);
----------------
fhahn wrote:

I don't think this is the correct fix.

There is no extra address computations that needs to be done by interleave groups usually, unless there are gaps. We use the address from the first member, for which we will have a GEP recipe, which should already account for the cost of the GEP.

It may be the case that the cost of the interleave group itself may not be accurate and TTI may need to be updated for Grace?



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


More information about the llvm-commits mailing list