[llvm] [VPlan] Add BranchOnMultiCond, use for early exit plans. (PR #172750)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 24 15:51:10 PST 2025
================
@@ -391,20 +391,21 @@ static bool hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
bool VPlanVerifier::verifyBlock(const VPBlockBase *VPB) {
auto *VPBB = dyn_cast<VPBasicBlock>(VPB);
// Check block's condition bit.
- if (!isa<VPIRBasicBlock>(VPB)) {
+ if (VPBB && !isa<VPIRBasicBlock>(VPB)) {
+ // VPRegionBlocks can have multiple successors (e.g., with
+ // BranchOnTwoConds) without needing a terminator, so only check
+ // VPBasicBlocks.
if (VPB->getNumSuccessors() > 1 ||
- (VPBB && VPBB->getParent() && VPBB->isExiting() &&
+ (VPBB->getParent() && VPBB->isExiting() &&
!VPBB->getParent()->isReplicator())) {
----------------
ayalz wrote:
Perhaps accounting for implicit backedge when counting successors of latch VPBB's is worth a public API.
https://github.com/llvm/llvm-project/pull/172750
More information about the llvm-commits
mailing list