Skip to content

Commit

Permalink
Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko
Browse files Browse the repository at this point in the history
Add `-Zremark-dir` unstable flag to write LLVM optimization remarks to YAML

This PR adds an option for `rustc` to emit LLVM optimization remarks to a set of YAML files, which can then be digested by existing tools, like https://github.com/OfekShilon/optview2. When `-Cremark-dir` is passed, and remarks are enabled (`-Cremark=all`), the remarks will be now written to the specified directory, **instead** of being printed to standard error output.  The files are named based on the CGU from which they are being generated.

Currently, the remarks are written using the LLVM streaming machinery, directly in the diagnostics handler. It seemed easier than going back to Rust and then form there back to C++ to use the streamer from the diagnostics handler. But there are many ways to implement this, of course, so I'm open to suggestions :)

I included some comments with questions into the code. Also, I'm not sure how to test this.

r? `@tmiasko`
  • Loading branch information
bors committed Jul 2, 2023
2 parents 257adf8 + 6e30d72 commit c6ea27b
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit c6ea27b

Please sign in to comment.