@@ -9141,6 +9141,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9141
9141
using namespace VPlanPatternMatch ;
9142
9142
VPRegionBlock *VectorLoopRegion = Plan->getVectorLoopRegion ();
9143
9143
VPBasicBlock *Header = VectorLoopRegion->getEntryBasicBlock ();
9144
+ VPBasicBlock *MiddleVPBB =
9145
+ cast<VPBasicBlock>(VectorLoopRegion->getSingleSuccessor ());
9144
9146
for (VPRecipeBase &R : Header->phis ()) {
9145
9147
auto *PhiR = dyn_cast<VPReductionPHIRecipe>(&R);
9146
9148
if (!PhiR || !PhiR->isInLoop () || (MinVF.isScalar () && !PhiR->isOrdered ()))
@@ -9159,13 +9161,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9159
9161
for (VPUser *U : Cur->users ()) {
9160
9162
auto *UserRecipe = cast<VPSingleDefRecipe>(U);
9161
9163
if (!UserRecipe->getParent ()->getEnclosingLoopRegion ()) {
9162
- assert ((match (U, m_Binary<VPInstruction::ExtractFromEnd>(
9163
- m_VPValue (), m_VPValue ())) ||
9164
- (isa<VPReplicateRecipe>(U) &&
9165
- cast<VPReplicateRecipe>(U)->getUnderlyingValue () ==
9166
- RdxDesc.IntermediateStore )) &&
9167
- " U must be either an ExtractFromEnd VPInstruction or a "
9168
- " uniform store sourced from the intermediate store." );
9164
+ assert (UserRecipe->getParent () == MiddleVPBB &&
9165
+ " U must be either in the loop region or the middle block." );
9169
9166
continue ;
9170
9167
}
9171
9168
Worklist.insert (UserRecipe);
@@ -9270,8 +9267,6 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9270
9267
}
9271
9268
VPBasicBlock *LatchVPBB = VectorLoopRegion->getExitingBasicBlock ();
9272
9269
Builder.setInsertPoint (&*LatchVPBB->begin ());
9273
- VPBasicBlock *MiddleVPBB =
9274
- cast<VPBasicBlock>(VectorLoopRegion->getSingleSuccessor ());
9275
9270
VPBasicBlock::iterator IP = MiddleVPBB->getFirstNonPhi ();
9276
9271
for (VPRecipeBase &R :
9277
9272
Plan->getVectorLoopRegion ()->getEntryBasicBlock ()->phis ()) {
0 commit comments