[Mlir-commits] [mlir] [MLIR] Introduce support for early exits (PR #166688)
Matthias Springer
llvmlistbot at llvm.org
Fri Jun 12 03:18:10 PDT 2026
================
@@ -519,25 +530,29 @@ represent possible continuations. Successors explicitly specify destination
blocks, so control flow within the region can only pass to one of the specified
successor blocks, as in a `branch` operation. When a terminator has no
successors, it may pass 1) control back to the containing operation, as in a
-`return` operation, or 2) define that control flow does not continue, as in
-`ub.unreachable`. Terminators without successors therefore do not necessarily
-imply a return to the containing operation, the specific dialect operation
-determines the terminator's semantics. Blocks (other than the entry block) that
-are not listed as a successor of any terminator operation are defined to be
-unreachable and can be removed without affecting the semantics of the
-containing operation.
+`return` operation, 2) define that control flow does not continue, as in
+`ub.unreachable`, or 3) request that the containing operation propagate breaking
+control flow outward toward a specific ancestor. This target designator is
+dialect-defined: it may be a builtin `token` operand, an integer count of region
----------------
matthias-springer wrote:
nit: The `Region-Exit Terminators` section below showcases the `token` mechanism. Do we need to mention `token`, integer count, symbols, etc. here or can it all be done in the section below? (In the second paragraph, where you say that the mechanism is dialect-defined.)
https://github.com/llvm/llvm-project/pull/166688
More information about the Mlir-commits
mailing list