rust/compiler
bors a55748ffe9 Auto merge of #84993 - eddyb:cg-ssa-on-demand-blocks, r=nagisa
rustc_codegen_ssa: only create backend `BasicBlock`s as-needed.

Instead of creating one backend (e.g. LLVM) block per MIR block ahead of time, and then deleting the ones that weren't visited, this PR moves to creating the blocks as they're needed (either reached via the RPO visit, or used as the target of a branch from a different block).

As deleting a block was the only `unsafe` builder method (generally we only *create* backend objects, not *remove* them), that's gone now and codegen is overall a bit safer.

The only change in output is the order of LLVM blocks (which AFAIK has no semantic meaning, other than the first block being the entry block). This happens because the blocks are now created due to control-flow edges, rather than MIR block order.

I'm making this a standalone PR because I keep getting wild perf results when I change *anything* in codegen, but if you want to read more about my plans in this area, see https://github.com/rust-lang/rust/pull/84771#issuecomment-830636256 (and https://github.com/rust-lang/rust/pull/84771#issue-628295651 - but that may be a bit outdated).

(You may notice some of the APIs in this PR, like `append_block`, don't help with the future plans - but I didn't want to include the necessary refactors that pass a build around everywhere, in this PR, so it's a small compromise)

r? `@nagisa` `@bjorn3`
2021-05-16 23:00:53 +00:00
..
rustc use jemallocator in rustc/rustdoc 2021-04-04 14:10:26 -07:00
rustc_apfloat Use iter::zip in compiler/ 2021-03-26 09:32:31 -07:00
rustc_arena Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
rustc_ast Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
rustc_ast_lowering Clarify error message when both asm! and global_asm! are unsupported 2021-05-13 22:31:58 +01:00
rustc_ast_passes Implement RFC 2951: Native link modifiers 2021-05-05 16:04:25 -07:00
rustc_ast_pretty Remove some unncessary spaces from pretty-printed tokenstream output 2021-05-15 12:05:03 -04:00
rustc_attr Allow specifying alignment for functions 2021-04-05 17:36:51 -04:00
rustc_builtin_macros Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
rustc_codegen_cranelift Auto merge of #83640 - bjorn3:shared_metadata_reader, r=nagisa 2021-05-14 12:58:58 +00:00
rustc_codegen_llvm rustc_codegen_ssa: append blocks to functions w/o creating a builder. 2021-05-17 00:04:09 +03:00
rustc_codegen_ssa rustc_codegen_ssa: append blocks to functions w/o creating a builder. 2021-05-17 00:04:09 +03:00
rustc_data_structures Only compute Obligation cache_key once in register_obligation_at 2021-05-04 11:57:53 -07:00
rustc_driver Auto merge of #83610 - bjorn3:driver_cleanup, r=cjgillot 2021-05-12 08:38:03 +00:00
rustc_error_codes swap function order for better read flow 2021-05-13 13:22:24 +02:00
rustc_errors Show macro name in 'this error originates in macro' message 2021-05-12 19:03:06 -04:00
rustc_expand Auto merge of #83813 - cbeuw:remap-std, r=michaelwoerister 2021-05-12 11:05:56 +00:00
rustc_feature add new attribute rustc_insignificant_dtor and a query to check if a type has a significant drop 2021-05-14 22:57:33 -04:00
rustc_fs_util
rustc_graphviz Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
rustc_hir Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
rustc_hir_pretty Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
rustc_incremental Auto merge of #83610 - bjorn3:driver_cleanup, r=cjgillot 2021-05-12 08:38:03 +00:00
rustc_index Change bitwise operator to more easily keep data in vector registers 2021-05-04 11:55:18 -04:00
rustc_infer Don't suggest adding 'static lifetime to arguments 2021-05-12 21:43:09 -04:00
rustc_interface fix version_str comment 2021-05-15 14:22:29 +02:00
rustc_lexer Fix outdated crate names in compiler docs 2021-04-08 11:12:14 -05:00
rustc_lint Fix unused attributes on macro_rules. 2021-05-15 16:13:46 -07:00
rustc_lint_defs Add additional migrations to handle auto-traits and clone traits 2021-05-06 14:17:59 -04:00
rustc_llvm Auto merge of #85190 - mati865:update-cc, r=Mark-Simulacrum 2021-05-14 04:12:40 +00:00
rustc_macros Use iter::zip in compiler/ 2021-03-26 09:32:31 -07:00
rustc_metadata Auto merge of #85211 - Aaron1011:metadata-invalid-span, r=michaelwoerister 2021-05-14 16:58:30 +00:00
rustc_middle Auto merge of #85328 - GuillaumeGomez:rollup-exe9nbj, r=GuillaumeGomez 2021-05-15 12:41:28 +00:00
rustc_mir Auto merge of #85332 - RalfJung:ptr-in-str, r=oli-obk 2021-05-16 09:49:12 +00:00
rustc_mir_build Check for inline assembly in THIR unsafeck 2021-05-14 09:03:30 -04:00
rustc_parse Rollup merge of #84793 - estebank:parse-struct-field-default, r=davidtwco 2021-05-12 17:19:25 +02:00
rustc_parse_format Rollup merge of #83348 - osa1:issue83344, r=jackh726 2021-03-28 01:33:13 +09:00
rustc_passes Auto merge of #85290 - Amanieu:asm_const_int, r=nagisa 2021-05-16 17:52:52 +00:00
rustc_plugin_impl Remove hir::Item::attrs. 2021-03-09 19:27:50 +01:00
rustc_privacy fix few typos 2021-04-19 15:57:08 +03:00
rustc_query_impl Apply --cfg parallel_compiler when documenting 2021-05-01 00:25:11 -04:00
rustc_query_system Show nicer error when an 'unstable fingerprints' error occurs 2021-05-10 17:43:51 -04:00
rustc_resolve Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
rustc_save_analysis Auto merge of #83813 - cbeuw:remap-std, r=michaelwoerister 2021-05-12 11:05:56 +00:00
rustc_serialize Auto merge of #83465 - michaelwoerister:safe-read_raw_bytes, r=cjgillot 2021-03-26 01:28:59 +00:00
rustc_session Auto merge of #83129 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakis 2021-05-13 10:49:29 +00:00
rustc_span add new attribute rustc_insignificant_dtor and a query to check if a type has a significant drop 2021-05-14 22:57:33 -04:00
rustc_symbol_mangling Rollup merge of #80525 - devsnek:wasm64, r=nagisa 2021-04-05 00:24:23 +02:00
rustc_target Auto merge of #85312 - ehuss:macro_use-unused-attr, r=petrochenkov 2021-05-16 20:19:45 +00:00
rustc_trait_selection have on_completion record subcycles 2021-05-13 05:58:21 -04:00
rustc_traits Auto merge of #83207 - oli-obk:valtree2, r=lcnr 2021-04-02 10:28:12 +00:00
rustc_ty_utils add new attribute rustc_insignificant_dtor and a query to check if a type has a significant drop 2021-05-14 22:57:33 -04:00
rustc_type_ir Make TypeFoldable::is_global() false when fresh tys/consts are present 2021-05-01 16:58:33 -04:00
rustc_typeck Auto merge of #85290 - Amanieu:asm_const_int, r=nagisa 2021-05-16 17:52:52 +00:00