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

Mehdi Amini llvmlistbot at llvm.org
Tue Jun 2 06:08:13 PDT 2026


================
@@ -98,6 +98,10 @@ def SameOperandsAndResultElementType :
   NativeOpTrait<"SameOperandsAndResultElementType">;
 // Op is a terminator.
 def Terminator : NativeOpTrait<"IsTerminator">;
+// Op is a region terminator for the immediate region only.
+def ImmediateRegionTerminator : NativeOpTrait<"RegionTerminator", [Terminator]>;
+// Op is a region terminator, potentially breaking multiple regions
+def RegionTerminator : NativeOpTrait<"RegionTerminator", [Terminator]>;
----------------
joker-eph wrote:

This is a current hole in MLIR that we don't identify RegionTerminator: if we have a terminator without operands we kind of assume it'll return. But things like ub.unreachable does not for example.

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


More information about the Mlir-commits mailing list