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

Mehdi Amini llvmlistbot at llvm.org
Mon Feb 23 06:06:13 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:

To really address the case I'm asking about, can we get an example with two iterations of this loop `  for (auto [index, rec] : vec) {` where `pred` is empty?

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


More information about the Mlir-commits mailing list