Skip to content

Commit c8e9da4

Browse files
committed
Update comments about the partitioning inefficiency
1 parent e60b0f8 commit c8e9da4

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/librustc_mir/monomorphize/partitioning.rs

-2
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,6 @@ fn merge_codegen_units<'tcx>(initial_partitioning: &mut PreInliningPartitioning<
427427
codegen_units.sort_by_key(|cgu| cgu.name().clone());
428428

429429
// Merge the two smallest codegen units until the target size is reached.
430-
// Note that "size" is estimated here rather inaccurately as the number of
431-
// translation items in a given unit. This could be improved on.
432430
while codegen_units.len() > target_cgu_count {
433431
// Sort small cgus to the back
434432
codegen_units.sort_by_key(|cgu| usize::MAX - cgu.size_estimate());

src/librustc_trans/base.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
824824
ongoing_translation.submit_pre_translated_module_to_llvm(tcx, metadata_module);
825825

826826
// We sort the codegen units by size. This way we can schedule work for LLVM
827-
// a bit more efficiently. Note that "size" is defined rather crudely at the
828-
// moment as it is just the number of TransItems in the CGU, not taking into
829-
// account the size of each TransItem.
827+
// a bit more efficiently.
830828
let codegen_units = {
831829
let mut codegen_units = codegen_units;
832830
codegen_units.sort_by_key(|cgu| usize::MAX - cgu.size_estimate());

0 commit comments

Comments
 (0)