[llvm] [VPlan] Add BranchOnMultiCond, use for early exit plans. (PR #172750)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 23 14:26:21 PST 2025


================
@@ -592,25 +592,26 @@ static bool hasConditionalTerminator(const VPBasicBlock *VPBB) {
   }
 
   const VPRecipeBase *R = &VPBB->back();
-  bool IsSwitch = isa<VPInstruction>(R) &&
-                  cast<VPInstruction>(R)->getOpcode() == Instruction::Switch;
-  bool IsCondBranch =
+  [[maybe_unused]] bool IsSwitch =
+      isa<VPInstruction>(R) &&
+      cast<VPInstruction>(R)->getOpcode() == Instruction::Switch;
+  [[maybe_unused]] bool IsBranchOnMultiCond = match(R, m_BranchOnMultiCond());
+  [[maybe_unused]] bool IsCondBranch =
       isa<VPBranchOnMaskRecipe>(R) ||
----------------
fhahn wrote:

BranchOnMask currenetly works per-lane in VPReplicateRegion. Once explicit unrolling is implemented for VPReplicateRegions (https://github.com/llvm/llvm-project/pull/170212 is a start), it can be (and be replaced by BranchOnCond after unrolling).

https://github.com/llvm/llvm-project/pull/172750


More information about the llvm-commits mailing list