[Mlir-commits] [mlir] [mlir][tosa] Fix check for isolated regions in `tosa.cond_if` (PR #143772)

Luke Hutton llvmlistbot at llvm.org
Fri Jul 18 07:37:34 PDT 2025


================
@@ -1229,18 +1252,15 @@ bool checkErrorIfCondIf(Operation *op) {
 
   mlir::Region &thenGraph = ifOp.getThenGraph();
   mlir::Region &elseGraph = ifOp.getElseGraph();
-  bool isThenGraphNullaryRegion = isNullaryRegion(thenGraph);
-  bool isElseGraphNullaryRegion = isNullaryRegion(elseGraph);
-  bool isInputListEmpty = ifOp.getInputList().size() == 0;
+  bool isThenGraphIsolatedRegion = isIsolatedRegion(thenGraph);
+  bool isElseGraphIsolatedRegion = isIsolatedRegion(elseGraph);
 
-  if ((isInputListEmpty != isThenGraphNullaryRegion) ||
-      (isInputListEmpty != isElseGraphNullaryRegion)) {
+  if (!isThenGraphIsolatedRegion || !isElseGraphIsolatedRegion) {
     op->emitOpError()
-        << "the current simplified form is not strictly conformant to the "
-           "spec, please use the generic format\n";
+        << "is not conformant to the TOSA specification. It requires the "
----------------
lhutton1 wrote:

Done

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


More information about the Mlir-commits mailing list