[llvm] [VPlan] Implement cloning of VPlans. (PR #73158)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 14 11:11:39 PST 2024


================
@@ -10078,7 +10078,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
         EpilogueVectorizerMainLoop MainILV(L, PSE, LI, DT, TLI, TTI, AC, ORE,
                                            EPI, &LVL, &CM, BFI, PSI, Checks);
 
-        VPlan &BestMainPlan = LVP.getBestPlanFor(EPI.MainLoopVF);
+        VPlan &BestMainPlan = *LVP.getBestPlanFor(EPI.MainLoopVF).clone();
----------------
ayalz wrote:

This cloning will enable LVP::executePlan() to drop the following guard:
```
  if (!IsEpilogueVectorization)
    VPlanTransforms::optimizeForVFAndUF(BestVPlan, BestVF, BestUF, PSE);
```
as mentioned in the summary, but that is left for a follow-up patch, effectively keeping this patch an NFC?

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


More information about the llvm-commits mailing list