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

Jakub Kuderski llvmlistbot at llvm.org
Sat Jan 31 17:23:36 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
----------------
kuhar wrote:

> The loop would not be removed because exit would presumably side-effecting.

Right, what I'm getting at is that the current wording focuses on not looping forever, but I think we also need to specify that the control will reach the next operation after the loop. Does exiting the program count as interacting with the environment?

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


More information about the Mlir-commits mailing list