From ce6666bd7cc71963b5b727db162954b2620ebee9 Mon Sep 17 00:00:00 2001 From: Alex Zinenko 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 106a794735090..798853a75441a 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(); }