@@ -2661,7 +2661,8 @@ void InnerLoopVectorizer::createVectorLoopSkeleton(StringRef Prefix) {
26612661 LI, nullptr , Twine (Prefix) + " scalar.ph" );
26622662 // NOTE: The Plan's scalar preheader isn't replaced with a VPIRBasicBlock
26632663 // wrapping LoopScalarPreHeader here at the moment, because the Plan's scalar
2664- // preheader may be unreachable at this point.
2664+ // preheader may be unreachable at this point. Instead it is replaced in
2665+ // createVectorizedLoopSkeleton.
26652666}
26662667
26672668// / Return the expanded step for \p ID using \p ExpandedSCEVs to look up SCEV
@@ -7578,10 +7579,10 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
75787579 // Set PlanForEarlyExitLoop to true if the BestPlan has been built from a
75797580 // loop with an uncountable early exit. The legacy cost model doesn't
75807581 // properly model costs for such loops.
7581- auto ExitBlocks = BestPlan.getExitBlocks ();
75827582 bool PlanForEarlyExitLoop =
7583- ExitBlocks.size () > 1 ||
7584- (ExitBlocks.size () == 1 && ExitBlocks[0 ]->getNumPredecessors () > 1 );
7583+ BestPlan.getVectorLoopRegion () &&
7584+ BestPlan.getVectorLoopRegion ()->getSingleSuccessor () !=
7585+ BestPlan.getMiddleBlock ();
75857586 assert ((BestFactor.Width == LegacyVF.Width || PlanForEarlyExitLoop ||
75867587 planContainsAdditionalSimplifications (getPlanFor (BestFactor.Width ),
75877588 CostCtx, OrigLoop) ||
0 commit comments