Skip to content

Commit 129e8ad

Browse files
committed
!fixup add assert for case where Incoming is a region
1 parent 1728599 commit 129e8ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static bool isVPIRInstructionPhi(const VPRecipeBase &R) {
180180
auto *VPIRI = dyn_cast<VPIRInstruction>(&R);
181181
return VPIRI && isa<PHINode>(VPIRI->getInstruction());
182182
}
183+
183184
bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
184185
if (!verifyPhiRecipes(VPBB))
185186
return false;
@@ -251,8 +252,12 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
251252
"Unexpected recipe with 2 or more predecessors");
252253
Incoming = UserVPBB->getPredecessors()[1];
253254
}
254-
if (auto *R = dyn_cast<VPRegionBlock>(Incoming))
255+
if (auto *R = dyn_cast<VPRegionBlock>(Incoming)) {
256+
assert(isa<VPWidenPHIRecipe>(UI) &&
257+
"Should only have a region as predecessor for "
258+
"VPWidenPHIRecipe");
255259
Incoming = R->getExiting();
260+
}
256261
if (Incoming != VPBB && !VPDT.dominates(VPBB, Incoming)) {
257262
errs() << "Use before def!\n";
258263
return false;

0 commit comments

Comments
 (0)