[llvm] cedb970 - [VPlan] Verify CFG invariants first (NFCI).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 4 08:29:39 PST 2024
Author: Florian Hahn
Date: 2024-03-04T16:29:19Z
New Revision: cedb9704bda4f4f9622ba60a18135d70569d0582
URL: https://github.com/llvm/llvm-project/commit/cedb9704bda4f4f9622ba60a18135d70569d0582
DIFF: https://github.com/llvm/llvm-project/commit/cedb9704bda4f4f9622ba60a18135d70569d0582.diff
LOG: [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
https://github.com/llvm/llvm-project/pull/76172.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
index 5da752f62cfced..7ebdb914fb852f 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
@@ -135,9 +135,6 @@ static bool hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
static bool verifyBlock(const VPBlockBase *VPB, const VPDominatorTree &VPDT) {
auto *VPBB = dyn_cast<VPBasicBlock>(VPB);
- if (VPBB && !verifyVPBasicBlock(VPBB, VPDT))
- return false;
-
// Check block's condition bit.
if (VPB->getNumSuccessors() > 1 ||
(VPBB && VPBB->getParent() && VPBB->isExiting() &&
@@ -196,7 +193,7 @@ static bool verifyBlock(const VPBlockBase *VPB, const VPDominatorTree &VPDT) {
return false;
}
}
- return true;
+ return !VPBB || verifyVPBasicBlock(VPBB, VPDT);
}
/// Helper function that verifies the CFG invariants of the VPBlockBases within
More information about the llvm-commits
mailing list