os-rust/compiler
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
..
rustc fix link 2023-03-11 10:53:47 -06:00
rustc_abi Auto merge of #112062 - lukas-code:unsized-layout, r=wesleywiser 2023-06-13 22:34:59 +00:00
rustc_apfloat
rustc_arena Extend unused_must_use to cover block exprs 2023-06-15 17:59:13 +08:00
rustc_ast Syntatically accept become expressions 2023-06-19 12:54:34 +00:00
rustc_ast_lowering Do not generate lifetime_mapping for RPIT no in_trait 2023-06-29 14:26:28 -03:00
rustc_ast_passes Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgr 2023-06-27 21:31:47 +00:00
rustc_ast_pretty Syntatically accept become expressions 2023-06-19 12:54:34 +00:00
rustc_attr Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck Rollup merge of #113174 - chenyukang:yukang-fix-102972-loop-next, r=compiler-errors 2023-07-01 13:46:01 +02:00
rustc_builtin_macros fix typo 2023-06-28 10:52:48 +08:00
rustc_codegen_cranelift Auto merge of #113116 - nnethercote:codegen-opts, r=oli-obk 2023-06-30 00:35:19 +00:00
rustc_codegen_gcc Auto merge of #112814 - antoyo:sync-cg_gcc-2023-06-19, r=bjorn3 2023-06-22 02:11:08 +00:00
rustc_codegen_llvm Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko 2023-07-02 12:48:44 +00:00
rustc_codegen_ssa Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko 2023-07-02 12:48:44 +00:00
rustc_const_eval Auto merge of #112718 - oli-obk:SIMD-destructure_mir_const, r=cjgillot 2023-07-02 07:43:36 +00:00
rustc_data_structures Remove SmallStr. 2023-06-29 11:45:52 +10:00
rustc_driver fix spelling error 2023-06-05 16:01:09 +02:00
rustc_driver_impl Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
rustc_error_codes Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
rustc_error_messages Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
rustc_errors s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList 2023-06-14 09:28:54 +02:00
rustc_expand Rollup merge of #111571 - jhpratt:proc-macro-span, r=m-ou-se 2023-06-28 18:28:46 +05:30
rustc_feature Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_fluent_macro Fix diagnostics with errors 2023-05-26 10:44:18 +00:00
rustc_fs_util Add try_canonicalize to rustc_fs_util and use it over fs::canonicalize 2023-03-16 21:50:23 +01:00
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
rustc_hir_analysis Rollup merge of #113182 - compiler-errors:rpit-stricter-captures, r=oli-obk 2023-07-01 13:46:01 +02:00
rustc_hir_pretty hir: Add Become expression kind 2023-06-26 08:56:32 +00:00
rustc_hir_typeck Put LayoutError behind reference to shrink result 2023-07-01 21:16:25 +02:00
rustc_incremental Applied nits 2023-06-11 22:45:04 -04:00
rustc_index Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth 2023-05-25 00:33:43 +00:00
rustc_infer Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errors 2023-07-01 01:53:10 +00:00
rustc_interface use LinkSelfContained for -C link-self-contained 2023-06-30 21:01:38 +00:00
rustc_lexer Don't try to eat non-existent decimal digits. 2023-05-15 18:33:12 +10:00
rustc_lint Fix dropping_copy_types lint from linting in match-arm with side-effects 2023-07-01 16:05:55 +02:00
rustc_lint_defs Rollup merge of #112670 - petrochenkov:typriv, r=eholk 2023-06-29 05:48:39 +02:00
rustc_llvm Add rustc option to output LLVM optimization remarks to YAML files 2023-07-02 13:41:36 +02:00
rustc_log Stabilize IsTerminal 2023-04-10 17:24:23 +09:00
rustc_macros Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwco 2023-06-28 03:47:02 +00:00
rustc_metadata Encode item bounds for DefKind::ImplTraitPlaceholder 2023-06-29 16:37:13 +00:00
rustc_middle Auto merge of #113256 - matthiaskrgr:rollup-poex8w2, r=matthiaskrgr 2023-07-02 10:22:49 +00:00
rustc_mir_build remove cruft 2023-06-28 01:55:32 -04:00
rustc_mir_dataflow Export AnalysisResults trait in rustc_mir_dataflow 2023-06-27 11:35:32 +02:00
rustc_mir_transform Auto merge of #113116 - nnethercote:codegen-opts, r=oli-obk 2023-06-30 00:35:19 +00:00
rustc_monomorphize Tweak thread names for CGU processing. 2023-06-26 09:14:45 +10:00
rustc_parse Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgr 2023-06-27 21:31:47 +00:00
rustc_parse_format Fix typos in compiler 2023-04-10 22:02:52 +02:00
rustc_passes Put LayoutError behind reference to shrink result 2023-07-01 21:16:25 +02:00
rustc_plugin_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_privacy Fix associated items effective visibility calculation for type privacy lints 2023-06-30 15:00:24 +03:00
rustc_query_impl Avoid calling queries during query stack printing 2023-06-27 16:12:07 +02:00
rustc_query_system Rollup merge of #112333 - Zoxc:try_collect_active_jobs-deadlock, r=cjgillot 2023-06-08 12:36:18 +02:00
rustc_resolve fix(resolve): skip assertion judgment when NonModule is dummy 2023-07-01 11:53:31 +08:00
rustc_serialize Fix the FileEncoder buffer size. 2023-05-15 08:59:11 +10:00
rustc_session Auto merge of #113040 - Kobzol:llvm-remark-streamer, r=tmiasko 2023-07-02 12:48:44 +00:00
rustc_smir Rollup merge of #112232 - fee1-dead-contrib:match-eq-const-msg, r=b-naber 2023-06-19 17:53:33 -07:00
rustc_span Auto merge of #113116 - nnethercote:codegen-opts, r=oli-obk 2023-06-30 00:35:19 +00:00
rustc_symbol_mangling Add AliasKind::Weak for type aliases. 2023-06-16 19:39:48 +00:00
rustc_target require -Zunstable-options to use new link-self-contained values and 2023-06-30 21:11:42 +00:00
rustc_trait_selection Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errors 2023-07-01 01:53:10 +00:00
rustc_traits Update chalk 2023-07-01 18:03:36 +02:00
rustc_transmute Put LayoutError behind reference to shrink result 2023-07-01 21:16:25 +02:00
rustc_ty_utils Put FnAbiError behind reference to shrink result 2023-07-01 21:16:27 +02:00
rustc_type_ir Add AliasKind::Weak for type aliases. 2023-06-16 19:39:48 +00:00