[Mlir-commits] [mlir] [mlir][gpu] `gpu-module-to-binary`: add option to dump intermediate files (PR #170016)

Ivan Butygin llvmlistbot at llvm.org
Mon Dec 1 02:25:27 PST 2025


================
@@ -64,8 +91,42 @@ void GpuModuleToBinaryPass::runOnOperation() {
   SmallVector<Attribute> librariesToLink;
   for (const std::string &path : linkFiles)
     librariesToLink.push_back(StringAttr::get(&getContext(), path));
+
+  // Create dump directory if specified.
+  if (!dumpIntermediates.empty()) {
+    if (std::error_code ec =
+            llvm::sys::fs::create_directories(dumpIntermediates)) {
+      getOperation()->emitError() << "Failed to create dump directory '"
+                                  << dumpIntermediates << "': " << ec.message();
----------------
Hardcode84 wrote:

It will succeed if dir already exists. `create_directories` has `IgnoreExisting = true` by default.

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


More information about the Mlir-commits mailing list