Skip to content

Commit

Permalink
[mlir] flush output in transform.print (#121382)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ftynse authored Jan 6, 2025
1 parent 9e4774b commit f6bfbc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mlir/lib/Dialect/Transform/IR/TransformOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

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

llvm::outs().flush();
return DiagnosedSilenceableFailure::success();
}

Expand Down

0 comments on commit f6bfbc8

Please sign in to comment.