[Mlir-commits] [mlir] [mlir][gpu] `gpu-module-to-binary`: add option to dump intermediate files (PR #170016)
Jakub Kuderski
llvmlistbot at llvm.org
Sun Nov 30 06:32:47 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();
+ return signalPassFailure();
+ }
+ }
+
+ // Create callbacks for dumping intermediate artifacts if requested
+ auto initialIRCallback = [&](llvm::Module &module) {
----------------
kuhar wrote:
Can you rename this to `moduleOp`? `module` becomes a keyword in C++20 and syntax highlighting picks it up as such
https://github.com/llvm/llvm-project/pull/170016
More information about the Mlir-commits
mailing list