[llvm] [VPlan] Add the cost of spills when considering register pressure (PR #179646)
John Brawn via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 12 05:34:53 PST 2026
================
@@ -4687,22 +4684,23 @@ LoopVectorizationPlanner::selectInterleaveCount(VPlan &Plan, ElementCount VF,
if (hasFindLastReductionPhi(Plan))
return 1;
+ VPRegisterUsage R =
+ calculateRegisterUsageForPlan(Plan, {VF}, TTI, CM.ValuesToIgnore)[0];
+
// If we did not calculate the cost for VF (because the user selected the VF)
// then we calculate the cost of VF here.
if (LoopCost == 0) {
if (VF.isScalar())
LoopCost = CM.expectedCost(VF);
else
- LoopCost = cost(Plan, VF);
+ LoopCost = cost(Plan, VF, &R);
----------------
john-brawn-arm wrote:
The problem with that is that it's the cost function that prints the "Cost for VF" message, so adding the spill cost after that would mean the message is misleading.
https://github.com/llvm/llvm-project/pull/179646
More information about the llvm-commits
mailing list