[llvm] [VPlan] Simplify Plan's entry in removeBranchOnConst. (PR #154510)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 16 00:21:52 PDT 2025
================
@@ -1927,7 +1927,7 @@ void VPlanTransforms::removeBranchOnConst(VPlan &Plan) {
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
vp_depth_first_shallow(Plan.getEntry()))) {
VPValue *Cond;
- if (VPBB->getNumSuccessors() != 2 || VPBB == Plan.getEntry() ||
+ if (VPBB->getNumSuccessors() != 2 || VPBB->empty() ||
----------------
ayalz wrote:
Thanks. Would it suffice to check only if VPBB terminator matches a BranchOnCond? Is the emptiness check needed to prevent failure of this match? Check for two successors could then be an assert.
https://github.com/llvm/llvm-project/pull/154510
More information about the llvm-commits
mailing list