rust/compiler/rustc_codegen_ssa/src
bors 131a03664e Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko
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`
2023-07-02 12:48:44 +00:00
..
back Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko 2023-07-02 12:48:44 +00:00
coverageinfo Isolate coverage FFI type layouts from their underlying LLVM C++ types 2023-05-09 18:08:32 +10:00
debuginfo Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
mir Auto merge of #112718 - oli-obk:SIMD-destructure_mir_const, r=cjgillot 2023-07-02 07:43:36 +00:00
traits Support 128-bit enum variant in debuginfo codegen 2023-06-10 03:39:24 +08:00
base.rs Rollup merge of #111322 - mirkootter:master, r=davidtwco 2023-06-29 16:36:30 +02:00
codegen_attrs.rs Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
common.rs Promote unchecked_add/sub/mul/shl/shr to mir::BinOp 2023-06-19 01:47:03 -07:00
errors.rs Add rustc option to output LLVM optimization remarks to YAML files 2023-07-02 13:41:36 +02:00
glue.rs Use size_of_val instead of manual calculation 2023-03-17 19:55:49 -07:00
lib.rs codegen: fix OperandRef subtype handling 2023-06-19 09:06:42 +02:00
meth.rs Add cross-language LLVM CFI support to the Rust compiler 2023-05-03 22:41:29 +00:00
mono_item.rs Store a LocalDefId in hir::AnonConst. 2022-11-13 14:06:11 +00:00
target_features.rs Rollup merge of #111322 - mirkootter:master, r=davidtwco 2023-06-29 16:36:30 +02:00