[Mlir-commits] [mlir] [mlirbc] Switch generator to enable write's with failures. (PR #182464)

Jacques Pienaar llvmlistbot at llvm.org
Thu Feb 26 08:52:40 PST 2026


================
@@ -341,10 +341,14 @@ void Generator::emitPrint(StringRef kind, StringRef type,
     }
 
     if (!pred.empty()) {
+      os << "return success();\n";
       os.unindent();
       os << "}\n";
+    } else {
+      os << "return success();\n";
     }
   }
+  os << "return failure();\n";
----------------
jpienaar wrote:

Oh, no, if you have no predicate, then yes it should unconditionally return and yes you are skipping the rest but anything but one without a predicate is a bug in the input. That's checked in line 309. So there is either 1 and it always returns, or more than 1 and it requires predicates.

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


More information about the Mlir-commits mailing list