[VPlan] Use unique_ptr to clean up duplicated plan.

This commit is contained in:
Florian Hahn 2024-01-27 20:51:13 +00:00
parent 517063e0f3
commit 7c03d5d41d
No known key found for this signature in database
GPG Key ID: DE52A1D3AE255351

View File

@ -10141,9 +10141,10 @@ 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).duplicate();
std::unique_ptr<VPlan> BestMainPlan(
LVP.getBestPlanFor(EPI.MainLoopVF).duplicate());
const auto &[ExpandedSCEVs, ReductionResumeValues] = LVP.executePlan(
EPI.MainLoopVF, EPI.MainLoopUF, BestMainPlan, MainILV, DT, true);
EPI.MainLoopVF, EPI.MainLoopUF, *BestMainPlan, MainILV, DT, true);
++LoopsVectorized;
// Second pass vectorizes the epilogue and adjusts the control flow