[Mlir-commits] [mlir] [mlir][gpu] `gpu-module-to-binary`: add option to dump intermediate files (PR #170016)
Mehdi Amini
llvmlistbot at llvm.org
Mon Dec 1 02:01:11 PST 2025
================
@@ -26,6 +32,27 @@ namespace mlir {
#include "mlir/Dialect/GPU/Transforms/Passes.h.inc"
} // namespace mlir
+static void dumpToFile(StringRef dumpDir, const llvm::Twine &filename,
+ function_ref<void(llvm::raw_ostream &)> writeContent) {
+ if (dumpDir.empty())
+ return;
+
+ llvm::SmallString<128> path(dumpDir);
+ llvm::sys::path::append(path, filename);
+
+ std::error_code ec;
+ llvm::ToolOutputFile output(path, ec, llvm::sys::fs::OF_None);
+ if (ec) {
+ LDBG() << "Failed to create file '" << path << "': " << ec.message()
+ << "\n";
----------------
joker-eph wrote:
Looks to me like the kind of things that should be a user-visible diagnostic.
https://github.com/llvm/llvm-project/pull/170016
More information about the Mlir-commits
mailing list