Skip to content

Commit a3a6614

Browse files
committed
Update assertion
1 parent 76d4dde commit a3a6614

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9141,6 +9141,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
91419141
using namespace VPlanPatternMatch;
91429142
VPRegionBlock *VectorLoopRegion = Plan->getVectorLoopRegion();
91439143
VPBasicBlock *Header = VectorLoopRegion->getEntryBasicBlock();
9144+
VPBasicBlock *MiddleVPBB =
9145+
cast<VPBasicBlock>(VectorLoopRegion->getSingleSuccessor());
91449146
for (VPRecipeBase &R : Header->phis()) {
91459147
auto *PhiR = dyn_cast<VPReductionPHIRecipe>(&R);
91469148
if (!PhiR || !PhiR->isInLoop() || (MinVF.isScalar() && !PhiR->isOrdered()))
@@ -9159,13 +9161,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
91599161
for (VPUser *U : Cur->users()) {
91609162
auto *UserRecipe = cast<VPSingleDefRecipe>(U);
91619163
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.");
91699166
continue;
91709167
}
91719168
Worklist.insert(UserRecipe);
@@ -9270,8 +9267,6 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
92709267
}
92719268
VPBasicBlock *LatchVPBB = VectorLoopRegion->getExitingBasicBlock();
92729269
Builder.setInsertPoint(&*LatchVPBB->begin());
9273-
VPBasicBlock *MiddleVPBB =
9274-
cast<VPBasicBlock>(VectorLoopRegion->getSingleSuccessor());
92759270
VPBasicBlock::iterator IP = MiddleVPBB->getFirstNonPhi();
92769271
for (VPRecipeBase &R :
92779272
Plan->getVectorLoopRegion()->getEntryBasicBlock()->phis()) {

0 commit comments

Comments
 (0)