[Mlir-commits] [mlir] [MLIR] Introduce support for early exits (PR #166688)

Mehdi Amini llvmlistbot at llvm.org
Fri Feb 20 12:16:11 PST 2026


================
@@ -705,6 +707,33 @@ class alignas(8) Operation final
   bool hasSuccessors() { return numSuccs != 0; }
   unsigned getNumSuccessors() { return numSuccs; }
 
+  /// Return true if this operation carries a num-breaking-regions value, i.e.
+  /// it is a RegionTerminator (scf.break, scf.continue, or similar) that can
+  /// exit one or more nested region levels in a single step.
+  bool isBreakingControlFlow() { return isBreakingControlFlowFlag; }
+
+  /// Return the number of nested region levels this terminator exits.
+  /// Returns 0 for ordinary operations that are not region terminators.
+  /// For a RegionTerminator, N = 1 means a normal yield to the immediate
+  /// parent; N = K means the terminator exits K region levels, bypassing K-1
+  /// intermediate PropagateControlFlowBreak ops on the way to the
+  /// HasBreakingControlFlowOpInterface ancestor at level K.
+  int getNumBreakingControlRegions() {
----------------
joker-eph wrote:

Fixed, thanks.

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


More information about the Mlir-commits mailing list