Skip to content

Commit 2934ba8

Browse files
ftynsepaulhuggett
authored andcommitted
[mlir] flush output in transform.print (llvm#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.
1 parent 2496985 commit 2934ba8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mlir/lib/Dialect/Transform/IR/TransformOps.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,7 @@ transform::PrintOp::apply(transform::TransformRewriter &rewriter,
28402840
llvm::outs() << "top-level ]]]\n";
28412841
state.getTopLevel()->print(llvm::outs(), printFlags);
28422842
llvm::outs() << "\n";
2843+
llvm::outs().flush();
28432844
return DiagnosedSilenceableFailure::success();
28442845
}
28452846

@@ -2849,6 +2850,7 @@ transform::PrintOp::apply(transform::TransformRewriter &rewriter,
28492850
llvm::outs() << "\n";
28502851
}
28512852

2853+
llvm::outs().flush();
28522854
return DiagnosedSilenceableFailure::success();
28532855
}
28542856

0 commit comments

Comments
 (0)