[Mlir-commits] [mlir] [mlir][Interfaces] Add `mustProgress` interface method + folding pattern (PR #179039)

Matthias Springer llvmlistbot at llvm.org
Sun Feb 1 03:52:48 PST 2026


================
@@ -351,6 +351,18 @@ def RegionBranchOpInterface : OpInterface<"RegionBranchOpInterface"> {
       (ins "::mlir::Type":$lhs, "::mlir::Type":$rhs), [{}],
       /*defaultImplementation=*/[{ return lhs == rhs; }]
     >,
+    InterfaceMethod<[{
+        Region branch ops that "must progress" are required to terminate (i.e.,
+        not loop infinitely between their regions) or interact with the
----------------
matthias-springer wrote:

I'd say "program termination" is an observable side effect.

I updated the documentation to also mention that the next op must be reached. This allows us to perform more aggressive dead code elimination, e.g., clearing out basic blocks that end with an `ub.unreachable` (which was discussed [here](https://github.com/llvm/llvm-project/pull/169873#discussion_r2570988454)).

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


More information about the Mlir-commits mailing list