[Mlir-commits] [mlir] [mlir] flush output in transform.print (PR #121382)
Oleksandr Alex Zinenko
llvmlistbot at llvm.org
Tue Dec 31 01:56:11 PST 2024
https://github.com/ftynse created https://github.com/llvm/llvm-project/pull/121382
Print operations are often used for debugging, immediately before the compiler aborts. In such cases, it is sometimes possible that the output isn't fully produced yet. Make sure it is by explicitly flushing the output.
>From ce6666bd7cc71963b5b727db162954b2620ebee9 Mon Sep 17 00:00:00 2001
From: Alex Zinenko <git at ozinenko.com>
Date: Tue, 31 Dec 2024 10:51:16 +0100
Subject: [PATCH] [mlir] flush output in transform.print
Print operations are often used for debugging, immediately before the compiler
aborts. In such cases, it is sometimes possible that the output isn't fully
produced yet. Make sure it is by explicitly flushing the output.
---
mlir/lib/Dialect/Transform/IR/TransformOps.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp
index 106a7947350907..798853a75441a1 100644
--- a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp
+++ b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp
@@ -2840,6 +2840,7 @@ transform::PrintOp::apply(transform::TransformRewriter &rewriter,
llvm::outs() << "top-level ]]]\n";
state.getTopLevel()->print(llvm::outs(), printFlags);
llvm::outs() << "\n";
+ llvm::outs().flush();
return DiagnosedSilenceableFailure::success();
}
@@ -2849,6 +2850,7 @@ transform::PrintOp::apply(transform::TransformRewriter &rewriter,
llvm::outs() << "\n";
}
+ llvm::outs().flush();
return DiagnosedSilenceableFailure::success();
}
More information about the Mlir-commits
mailing list