[llvm] [VPlan] Update getBestPlan to return VF, use also for epilogue vec. (PR #98821)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 12:26:54 PDT 2024


================
@@ -9971,8 +9968,9 @@ bool LoopVectorizePass::processLoop(Loop *L) {
       InnerLoopUnroller Unroller(L, PSE, LI, DT, TLI, TTI, AC, ORE, IC, &LVL,
                                  &CM, BFI, PSI, Checks);
 
-      VPlan &BestPlan = LVP.getBestPlan();
-      assert(BestPlan.hasScalarVFOnly() &&
+      ElementCount BestVF = LVP.getBestVF();
+      VPlan &BestPlan = LVP.getBestPlanFor(BestVF);
+      assert(BestVF.isScalar() &&
              "VPlan cost model and legacy cost model disagreed");
       LVP.executePlan(VF.Width, IC, BestPlan, Unroller, DT, false);
----------------
ayalz wrote:

```suggestion
      LVP.executePlan(BestVF, IC, BestPlan, Unroller, DT, false);
```
following the typical pattern of having `LVP.executePlan(VF, IC, Plan, ...)` follow `VPlan &Plan = LVP.getPlanFor(VF)`.

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


More information about the llvm-commits mailing list