@@ -7626,16 +7626,16 @@ static void createAndCollectMergePhiForReduction(
76267626
76277627DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan (
76287628 ElementCount BestVF, unsigned BestUF, VPlan &BestVPlan,
7629- InnerLoopVectorizer &ILV, DominatorTree *DT, bool IsEpilogueVectorization ,
7629+ InnerLoopVectorizer &ILV, DominatorTree *DT, bool VectorizingEpilogue ,
76307630 const DenseMap<const SCEV *, Value *> *ExpandedSCEVs) {
76317631 assert (BestVPlan.hasVF (BestVF) &&
76327632 " Trying to execute plan with unsupported VF" );
76337633 assert (BestVPlan.hasUF (BestUF) &&
76347634 " Trying to execute plan with unsupported UF" );
76357635 assert (
7636- (IsEpilogueVectorization || !ExpandedSCEVs) &&
7636+ ((VectorizingEpilogue && ExpandedSCEVs) ||
7637+ (!VectorizingEpilogue && !ExpandedSCEVs)) &&
76377638 " expanded SCEVs to reuse can only be used during epilogue vectorization" );
7638- (void )IsEpilogueVectorization;
76397639
76407640 // TODO: Move to VPlan transform stage once the transition to the VPlan-based
76417641 // cost model is complete for better cost estimates.
@@ -7661,8 +7661,8 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
76617661 if (!ILV.getTripCount ())
76627662 ILV.setTripCount (State.get (BestVPlan.getTripCount (), VPLane (0 )));
76637663 else
7664- assert (IsEpilogueVectorization && " should only re-use the existing trip "
7665- " count during epilogue vectorization" );
7664+ assert (VectorizingEpilogue && " should only re-use the existing trip "
7665+ " count during epilogue vectorization" );
76667666
76677667 // 1. Set up the skeleton for vectorization, including vector pre-header and
76687668 // middle block. The vector loop is created during VPlan execution.
@@ -7715,7 +7715,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
77157715 for (VPRecipeBase &R : *ExitVPBB) {
77167716 createAndCollectMergePhiForReduction (
77177717 dyn_cast<VPInstruction>(&R), State, OrigLoop,
7718- State.CFG .VPBB2IRBB [ExitVPBB], ExpandedSCEVs );
7718+ State.CFG .VPBB2IRBB [ExitVPBB], VectorizingEpilogue );
77197719 }
77207720
77217721 // 2.6. Maintain Loop Hints
@@ -10233,7 +10233,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1023310233
1023410234 std::unique_ptr<VPlan> BestMainPlan (BestPlan.duplicate ());
1023510235 auto ExpandedSCEVs = LVP.executePlan (EPI.MainLoopVF , EPI.MainLoopUF ,
10236- *BestMainPlan, MainILV, DT, true );
10236+ *BestMainPlan, MainILV, DT, false );
1023710237 ++LoopsVectorized;
1023810238
1023910239 // Second pass vectorizes the epilogue and adjusts the control flow
0 commit comments