[Mlir-commits] [mlir] [mlir][gpu] `gpu-module-to-binary`: add option to dump intermediate files (PR #170016)
Ivan Butygin
llvmlistbot at llvm.org
Sun Nov 30 08:21:07 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) {
----------------
Hardcode84 wrote:
done
https://github.com/llvm/llvm-project/pull/170016
More information about the Mlir-commits
mailing list