Skip to content

Commit cedb970

Browse files
committed
[VPlan] Verify CFG invariants first (NFCI).
Verifying CFG invariants of a block before verifying its contents allows contents verification to rely on the CFG invariants (e.g. that there's a vector loop region that can be retrieved). This avoids extra checks in llvm#76172.
1 parent 2a65941 commit cedb970

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ static bool hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
135135

136136
static bool verifyBlock(const VPBlockBase *VPB, const VPDominatorTree &VPDT) {
137137
auto *VPBB = dyn_cast<VPBasicBlock>(VPB);
138-
if (VPBB && !verifyVPBasicBlock(VPBB, VPDT))
139-
return false;
140-
141138
// Check block's condition bit.
142139
if (VPB->getNumSuccessors() > 1 ||
143140
(VPBB && VPBB->getParent() && VPBB->isExiting() &&
@@ -196,7 +193,7 @@ static bool verifyBlock(const VPBlockBase *VPB, const VPDominatorTree &VPDT) {
196193
return false;
197194
}
198195
}
199-
return true;
196+
return !VPBB || verifyVPBasicBlock(VPBB, VPDT);
200197
}
201198

202199
/// Helper function that verifies the CFG invariants of the VPBlockBases within

0 commit comments

Comments
 (0)