Skip to content

Commit

Permalink
[DRAFT] Generate CGUs in parallel.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Nov 6, 2024
1 parent fbab782 commit 2bb6fb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,14 +736,14 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
// This likely is a temporary measure. Once we don't have to support the
// non-parallel compiler anymore, we can compile CGUs end-to-end in
// parallel and get rid of the complicated scheduling logic.
let mut pre_compiled_cgus = if tcx.sess.threads() > 1 {
let mut pre_compiled_cgus = if true || tcx.sess.threads() > 1 {
tcx.sess.time("compile_first_CGU_batch", || {
// Try to find one CGU to compile per thread.
let cgus: Vec<_> = cgu_reuse
.iter()
.enumerate()
.filter(|&(_, reuse)| reuse == &CguReuse::No)
.take(tcx.sess.threads())
//.take(tcx.sess.threads())
.collect();

// Compile the found CGUs in parallel.
Expand Down

0 comments on commit 2bb6fb5

Please sign in to comment.