rust/compiler
bors bdaa901049 Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obk
Add a MIR pass manager (Taylor's Version)

The final draft of #91386 and #77665.

While the compile-time constraints in #91386 are cool, I decided on a more minimal approach for now. I want to explore phase constraints and maybe relative-ordering constraints in the future, though. This should preserve existing behavior **exactly** (please let me know if it doesn't) while making the following changes to the way we organize things today:

- Each `MirPhase` now corresponds to a single MIR pass. `run_passes` is not responsible for listing the correct MIR phase.
- `run_passes` no longer silently skips passes if the declared MIR phase is greater than or equal to the body's. This has bitten me multiple times. If you want this behavior, you can always branch on `body.phase` yourself.
- If your pass is solely to emit errors, you can use the `MirLint` interface instead, which gets a shared reference to `Body` instead of a mutable one. By differentiating the two, I hope to make it clearer in the short term where lints belong in the pipeline. In the long term perhaps we could enforce this at compile-time?
- MIR is no longer dumped for passes that aren't enabled, or for lints.

I tried to check that `-Zvalidate` still works correctly, since the MIR phase is now updated as soon as the associated pass is done, instead of at the end of all the passes in `run_passes`. However, it looks like `-Zvalidate` is broken with current nightlies anyways 😢 (it spits out a bunch of errors).

cc `@oli-obk` `@wesleywiser`

r? rust-lang/wg-mir-opt
2021-12-05 03:41:18 +00:00
..
rustc Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_apfloat Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_arena Add some comments. 2021-11-19 07:52:59 +11:00
rustc_ast Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
rustc_ast_lowering add unwind_asm feature gate for may_unwind option 2021-12-03 23:51:49 +01:00
rustc_ast_passes Rollup merge of #91208 - estebank:eq-constraint, r=cjgillot 2021-11-27 11:46:44 +01:00
rustc_ast_pretty Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
rustc_attr re-format with new rustfmt 2021-11-30 13:08:41 -05:00
rustc_borrowck Auto merge of #88439 - cynecx:unwind_asm, r=Amanieu 2021-12-04 05:59:16 +00:00
rustc_builtin_macros Rollup merge of #90519 - estebank:issue-84003, r=petrochenkov 2021-12-04 10:42:20 +01:00
rustc_codegen_cranelift cg_cranelift: check may_unwind flag instead of cleanup 2021-12-03 23:51:49 +01:00
rustc_codegen_gcc rustc_codegen_gcc: proper check for may_unwind 2021-12-03 23:51:49 +01:00
rustc_codegen_llvm LLVM codgen support for unwinding inline assembly 2021-12-03 23:51:49 +01:00
rustc_codegen_ssa LLVM codgen support for unwinding inline assembly 2021-12-03 23:51:49 +01:00
rustc_const_eval Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obk 2021-12-05 03:41:18 +00:00
rustc_data_structures Rollup merge of #88906 - Kixunil:box-maybe-uninit-write, r=dtolnay 2021-12-03 06:24:11 +01:00
rustc_driver add rustc option for using LLVM stack smash protection 2021-11-22 20:06:22 +01:00
rustc_error_codes Clarify and tidy up explanation of E0038 2021-11-30 09:25:17 -08:00
rustc_errors Rollup merge of #91394 - Mark-Simulacrum:bump-stage0, r=pietroalbini 2021-12-02 15:52:03 +01:00
rustc_expand Rollup merge of #91385 - ecstatic-morse:pat-param-spec-suggest, r=estebank 2021-12-04 02:26:23 +01:00
rustc_feature add unwind_asm feature gate for may_unwind option 2021-12-03 23:51:49 +01:00
rustc_fs_util Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_hir Rollup merge of #90519 - estebank:issue-84003, r=petrochenkov 2021-12-04 10:42:20 +01:00
rustc_hir_pretty Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
rustc_incremental Add -Zassert-incr-state to assert state of incremental cache 2021-11-12 13:41:46 -06:00
rustc_index Auto merge of #90491 - Mark-Simulacrum:push-pred-faster, r=matthewjasper 2021-11-24 15:51:46 +00:00
rustc_infer Rollup merge of #90023 - b-naber:postpone_const_eval_infer_vars, r=nikomatsakis 2021-12-05 00:37:58 +01:00
rustc_interface expand: Turn ast::Crate into a first class expansion target 2021-11-28 15:48:55 +08:00
rustc_lexer Auto merge of #91393 - Julian-Wollersberger:lexer_optimization, r=petrochenkov 2021-12-03 13:20:14 +00:00
rustc_lint Use let_else in some more places in rustc_lint 2021-12-03 03:51:47 +01:00
rustc_lint_defs Properly register text_direction_codepoint_in_comment lint. 2021-11-05 20:12:40 +01:00
rustc_llvm LLVM codgen support for unwinding inline assembly 2021-12-03 23:51:49 +01:00
rustc_macros Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
rustc_metadata Improve suggestion for extern crate self error message 2021-12-01 21:59:54 +00:00
rustc_middle Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obk 2021-12-05 03:41:18 +00:00
rustc_mir_build Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
rustc_mir_dataflow Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obk 2021-12-05 03:41:18 +00:00
rustc_mir_transform Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obk 2021-12-05 03:41:18 +00:00
rustc_monomorphize Rollup merge of #90701 - michaelwoerister:more-artifact-sizes, r=davidtwco 2021-11-09 19:00:45 +01:00
rustc_parse Rollup merge of #90022 - hkmatsumoto:self-upper-as-generic-parameter, r=jackh726 2021-12-05 00:37:56 +01:00
rustc_parse_format Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_passes Update invalid crate attributes, add help message 2021-12-03 18:38:32 +00:00
rustc_plugin_impl Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
rustc_privacy Take a LocalDefId in expect_*item. 2021-11-28 21:09:45 +01:00
rustc_query_impl Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_query_system std: Stabilize the thread_local_const_init feature 2021-11-29 07:23:46 -08:00
rustc_resolve Annotate derived spans and move span suggestion code 2021-12-03 18:41:40 +00:00
rustc_save_analysis Give inline const separate DefKind 2021-11-07 03:59:06 +00:00
rustc_serialize Avoid generating empty closures for fieldless enums 2021-11-22 21:22:35 -05:00
rustc_session Move instrument coverage config getters to Options 2021-12-02 17:12:59 -08:00
rustc_span Rollup merge of #91355 - alexcrichton:stabilize-thread-local-const, r=m-ou-se 2021-12-05 00:38:00 +01:00
rustc_symbol_mangling Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_target Auto merge of #91003 - psumbera:sparc64-abi, r=nagisa 2021-12-02 02:59:44 +00:00
rustc_trait_selection Rollup merge of #90519 - estebank:issue-84003, r=petrochenkov 2021-12-04 10:42:20 +01:00
rustc_traits Reduce boilerplate around infallible folders 2021-12-02 16:14:16 +00:00
rustc_ty_utils Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino" 2021-12-03 10:11:21 -03:00
rustc_type_ir Add two inline annotations for hot functions 2021-10-03 12:43:43 -04:00
rustc_typeck Rollup merge of #90519 - estebank:issue-84003, r=petrochenkov 2021-12-04 10:42:20 +01:00