Skip to content

Commit 7c03d5d

Browse files
committed
[VPlan] Use unique_ptr to clean up duplicated plan.
1 parent 517063e commit 7c03d5d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10141,9 +10141,10 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1014110141
EpilogueVectorizerMainLoop MainILV(L, PSE, LI, DT, TLI, TTI, AC, ORE,
1014210142
EPI, &LVL, &CM, BFI, PSI, Checks);
1014310143

10144-
VPlan &BestMainPlan = *LVP.getBestPlanFor(EPI.MainLoopVF).duplicate();
10144+
std::unique_ptr<VPlan> BestMainPlan(
10145+
LVP.getBestPlanFor(EPI.MainLoopVF).duplicate());
1014510146
const auto &[ExpandedSCEVs, ReductionResumeValues] = LVP.executePlan(
10146-
EPI.MainLoopVF, EPI.MainLoopUF, BestMainPlan, MainILV, DT, true);
10147+
EPI.MainLoopVF, EPI.MainLoopUF, *BestMainPlan, MainILV, DT, true);
1014710148
++LoopsVectorized;
1014810149

1014910150
// Second pass vectorizes the epilogue and adjusts the control flow

0 commit comments

Comments
 (0)