Skip to content

Commit ac47a25

Browse files
committed
XXX: process-by-size
1 parent eb1af88 commit ac47a25

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ use rustc_span::symbol::sym;
3838
use rustc_span::Symbol;
3939
use rustc_target::abi::{Align, FIRST_VARIANT};
4040

41+
use std::cmp;
4142
use std::collections::BTreeSet;
4243
use std::time::{Duration, Instant};
4344

44-
use itertools::Itertools;
45-
4645
pub fn bin_op_to_icmp_predicate(op: hir::BinOpKind, signed: bool) -> IntPredicate {
4746
match op {
4847
hir::BinOpKind::Eq => IntPredicate::IntEQ,
@@ -674,10 +673,8 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
674673
// are large size variations, this can reduce memory usage significantly.
675674
let codegen_units: Vec<_> = {
676675
let mut sorted_cgus = codegen_units.iter().collect::<Vec<_>>();
677-
sorted_cgus.sort_by_cached_key(|cgu| cgu.size_estimate());
678-
679-
let (first_half, second_half) = sorted_cgus.split_at(sorted_cgus.len() / 2);
680-
second_half.iter().rev().interleave(first_half).copied().collect()
676+
sorted_cgus.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate()));
677+
sorted_cgus
681678
};
682679

683680
// Calculate the CGU reuse

compiler/rustc_monomorphize/src/partitioning.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ fn debug_dump<'a, 'tcx: 'a>(
10301030
}
10311031
};
10321032

1033-
eprintln!("{}", dump());
1033+
debug!("{}", dump());
10341034
}
10351035

10361036
#[inline(never)] // give this a place in the profiler

0 commit comments

Comments
 (0)