[Mlir-commits] [mlir] [mlir][LangRef] Clarify terminator continuations (PR #201111)

Matthias Springer llvmlistbot at llvm.org
Tue Jun 2 08:10:20 PDT 2026


================
@@ -503,25 +505,27 @@ In MLIR, control flow semantics of a region is indicated by
 [RegionKind::SSACFG](Interfaces.md/#regionkindinterfaces). Informally, these
 regions support semantics where operations in a region 'execute sequentially'.
 Before an operation executes, its operands have well-defined values. After an
-operation executes, the operands have the same values and results also have
-well-defined values. After an operation executes, the next operation in the
-block executes until the operation is the terminator operation at the end of a
-block, in which case some other operation will execute. The determination of the
-next instruction to execute is the 'passing of control flow'.
+operation executes and has a normal continuation, the operands have the same
+values and results also have well-defined values. The next operation in the
+block then executes until the operation is the terminator operation at the end
+of a block, in which case the terminator determines the next normal
+continuation, if any. The determination of the next instruction to execute is
+the 'passing of control flow'.
 
 In general, when control flow is passed to an operation, MLIR does not restrict
 when control flow enters or exits the regions contained in that operation.
 However, when control flow enters a region, it always begins in the first block
 of the region, called the *entry* block. Terminator operations ending each block
-represent control flow by explicitly specifying the successor blocks of the
-block. Control flow can only pass to one of the specified successor blocks as in
-a `branch` operation, or back to the containing operation as in a `return`
-operation. Terminator operations without successors can only pass control back
-to the containing operation. Within these restrictions, the particular semantics
-of terminator operations is determined by the specific dialect operations
-involved. Blocks (other than the entry block) that are not listed as a successor
-of a terminator operation are defined to be unreachable and can be removed
-without affecting the semantics of the containing operation.
+represent possible normal continuations. Successor operands explicitly specify
----------------
matthias-springer wrote:

This wording clashes with the wording above, which says that the `ub.unreachable` terminator is "no normal continuation at all".

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


More information about the Mlir-commits mailing list