Skip to content

Commit

Permalink
Auto merge of rust-lang#122744 - RalfJung:check-mono-items, r=<try>
Browse files Browse the repository at this point in the history
experiment: run mono-item collection in check build

r? `@ghost`
This is just to get an upper bound to the perf overhead associated with fixing rust-lang#99682. We could be a bit more clever and only perform collection, not partitioning, or even more clever and do "mentioned items" collection rather than full collection (when rust-lang#122568 lands) -- but for now let's just get a ballpark number.
  • Loading branch information
bors committed Mar 19, 2024
2 parents a385e56 + ceefc85 commit 447c90e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
metadata: EncodedMetadata,
need_metadata_module: bool,
) -> OngoingCodegen<B> {
// Run the monomorphization collector and partition the collected items into
// codegen units.
let codegen_units = tcx.collect_and_partition_mono_items(()).1;

// Skip crate items and just output metadata in -Z no-codegen mode.
if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() {
let ongoing_codegen = start_async_codegen(backend, tcx, target_cpu, metadata, None);
Expand All @@ -586,10 +590,6 @@ pub fn codegen_crate<B: ExtraBackendMethods>(

let cgu_name_builder = &mut CodegenUnitNameBuilder::new(tcx);

// Run the monomorphization collector and partition the collected items into
// codegen units.
let codegen_units = tcx.collect_and_partition_mono_items(()).1;

// Force all codegen_unit queries so they are already either red or green
// when compile_codegen_unit accesses them. We are not able to re-execute
// the codegen_unit query from just the DepNode, so an unknown color would
Expand Down

0 comments on commit 447c90e

Please sign in to comment.