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

Mehdi Amini llvmlistbot at llvm.org
Fri Feb 20 02:56:46 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";
----------------
joker-eph wrote:

I don't understand this logic above, could there be a test change to help with this?

In particular the newly added return success() look like unconditional early exits, but it's all in a loop where you expect more than the first iteration to be able to write something...

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


More information about the Mlir-commits mailing list