rust/compiler
Tyson Nottingham 5f243d3c2b rustc_codegen_ssa: tune codegen according to available concurrency
This change tunes ahead-of-time codegening according to the amount of
concurrency available, rather than according to the number of CPUs on
the system. This can lower memory usage by reducing the number of
compiled LLVM modules in memory at once, particularly across several
rustc instances.

Previously, each rustc instance would assume that it should codegen
ahead of time to meet the demand of number-of-CPUs workers. But often, a
rustc instance doesn't have nearly that much concurrency available to
it, because the concurrency availability is split, via the jobserver,
across all active rustc instances spawned by the driving cargo process,
and is further limited by the `-j` flag argument. Therefore, each rustc
might have had several times the number of LLVM modules in memory than
it really needed to meet demand. If the modules were large, the effect
on memory usage would be noticeable.

With this change, the required amount of ahead-of-time codegen scales up
with the actual number of workers running within a rustc instance. Note
that the number of workers running can be less than the actual
concurrency available to a rustc instance. However, if more concurrency
is actually available, workers are spun up quickly as job tokens are
acquired, and the ahead-of-time codegen scales up quickly as well.
2021-02-15 13:02:49 -08:00
..
rustc just max_level_info 2020-09-11 09:37:51 -07:00
rustc_apfloat Backport another LLVM commit to rustc_apfloat 2020-10-04 02:02:25 +02:00
rustc_arena Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-se 2021-01-31 01:47:25 +01:00
rustc_ast Auto merge of #80860 - camelid:nodeid-docs, r=sanxiyn 2021-02-11 00:51:45 +00:00
rustc_ast_lowering Rename HIR UnOp variants 2021-02-09 11:39:20 +03:00
rustc_ast_passes Auto merge of #81346 - hug-dev:nonsecure-call-abi, r=jonas-schievink 2021-02-03 06:00:43 +00:00
rustc_ast_pretty Fix pretty printer macro_rules with semicolon. 2021-02-08 12:08:27 -08:00
rustc_attr Never MIR inline functions with a different instruction set 2021-02-05 00:00:00 +00:00
rustc_builtin_macros Borrow builder only once in debug derive 2021-02-10 00:00:00 +00:00
rustc_codegen_cranelift Add a new ABI to support cmse_nonsecure_call 2021-02-02 13:04:31 +00:00
rustc_codegen_llvm HWASan support 2021-02-07 23:48:58 -08:00
rustc_codegen_ssa rustc_codegen_ssa: tune codegen according to available concurrency 2021-02-15 13:02:49 -08:00
rustc_data_structures Only initialize what is used 2021-02-10 09:20:41 +01:00
rustc_driver Indicate both start and end of pass RSS in time-passes output 2021-01-29 12:46:29 -08:00
rustc_error_codes Improve long explanation for E0542 and E0546 2021-02-11 16:26:07 +01:00
rustc_errors Make sure all fields are accounted for in `encode_fields!` 2021-02-07 14:54:22 -08:00
rustc_expand add method to construct def site path as a vec of idents 2021-02-09 13:42:35 +01:00
rustc_feature Feature gate macro attributes in `#[derive]` output 2021-02-07 20:08:45 +03:00
rustc_fs_util Optimize away a `fs::metadata` call. 2021-01-06 08:33:15 -08:00
rustc_graphviz remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
rustc_hir Rename HIR UnOp variants 2021-02-09 11:39:20 +03:00
rustc_hir_pretty hir pretty printing 2021-02-04 16:20:57 +01:00
rustc_incremental Auto merge of #80957 - tgnottingham:direct_serialize_depgraph, r=michaelwoerister 2021-01-19 19:36:41 +00:00
rustc_index Auto merge of #81498 - thomaseizinger:ice-workaround-56935-rustc-index, r=matthewjasper 2021-02-07 08:09:58 +00:00
rustc_infer Fix suggestion to introduce explicit lifetime 2021-02-12 00:48:44 +09:00
rustc_interface Box the biggest ast::ItemKind variants 2021-02-01 09:23:39 +01:00
rustc_lexer Return EOF_CHAR constant instead of magic char. 2021-01-07 13:20:04 +01:00
rustc_lint Auto merge of #79804 - tmiasko:improper-ctypes-no-niche, r=pnkfelix 2021-02-10 12:56:09 +00:00
rustc_lint_defs Add `--extern-loc` to augment unused crate dependency diagnostics 2021-02-07 14:54:20 -08:00
rustc_llvm HWASan support 2021-02-07 23:48:58 -08:00
rustc_macros Switch query descriptions to just String 2021-02-08 17:20:41 -05:00
rustc_metadata Rollup merge of #81861 - tmiasko:mir-bytes, r=wesleywiser 2021-02-08 19:28:23 +01:00
rustc_middle Auto merge of #81744 - rylev:overlapping-early-exit2, r=lcnr 2021-02-12 17:38:15 +00:00
rustc_mir Rollup merge of #81479 - osa1:issue24151, r=lcnr 2021-02-12 22:53:29 +01:00
rustc_mir_build Auto merge of #81350 - tmiasko:instrument-debug, r=lcnr 2021-02-11 13:44:00 +00:00
rustc_parse parser: Fix panic in 'const impl' recovery 2021-02-08 10:46:19 +03:00
rustc_parse_format parse_format: treat r" as a literal 2021-02-06 15:01:07 +00:00
rustc_passes Rename HIR UnOp variants 2021-02-09 11:39:20 +03:00
rustc_plugin_impl Store ForeignItem in a side table. 2020-11-26 21:29:27 +01:00
rustc_privacy more things are const evaluatable *sparkles* 2021-02-01 20:05:50 +00:00
rustc_query_system Auto merge of #81892 - jyn514:no-inline, r=cjgillot 2021-02-09 18:37:33 +00:00
rustc_resolve resolve: Remove visibility hacks for enum variants and trait items 2021-02-10 22:46:44 +03:00
rustc_save_analysis Use Option::map_or instead of `.map(..).unwrap_or(..)` 2021-01-14 19:23:59 +01:00
rustc_serialize Revert stabilizing integer::BITS. 2021-02-03 22:23:58 +01:00
rustc_session HWASan support 2021-02-07 23:48:58 -08:00
rustc_span Rollup merge of #81506 - vo4:hwasan, r=nagisa 2021-02-12 22:53:30 +01:00
rustc_symbol_mangling Rollup merge of #80959 - jhpratt:unsigned_abs-stabilization, r=m-ou-se 2021-01-30 13:36:44 +09:00
rustc_target Stack probes: fix error message 2021-02-11 20:33:16 +01:00
rustc_trait_selection Auto merge of #81744 - rylev:overlapping-early-exit2, r=lcnr 2021-02-12 17:38:15 +00:00
rustc_traits Update Chalk 2021-02-02 12:37:22 -05:00
rustc_ty_utils Infallible version of def_span. 2021-01-23 13:35:22 +01:00
rustc_type_ir Move a few more types to `rustc_type_ir` 2021-01-18 21:06:12 +01:00
rustc_typeck Rollup merge of #82031 - LingMan:unneeded_var, r=varkor 2021-02-13 16:36:47 +09:00