File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ impl<'tcx> MonoItem<'tcx> {
61
61
MonoItem :: Fn ( instance) => {
62
62
// Estimate the size of a function based on how many statements
63
63
// it contains.
64
- tcx. instance_def_size_estimate ( instance. def )
64
+ 1 + tcx. instance_def_size_estimate ( instance. def )
65
65
}
66
66
// Conservatively estimate the size of a static declaration
67
67
// or assembly to be 1.
Original file line number Diff line number Diff line change @@ -322,9 +322,9 @@ fn merge_codegen_units<'tcx>(
322
322
// Having multiple CGUs can drastically speed up compilation. But for
323
323
// non-incremental builds, tiny CGUs slow down compilation *and* result in
324
324
// worse generated code. So we don't allow CGUs smaller than this (unless
325
- // there is just one CGU, of course). Note that CGU sizes of 100 ,000+ are
325
+ // there is just one CGU, of course). Note that CGU sizes of 20 ,000+ are
326
326
// common in larger programs, so this isn't all that large.
327
- const NON_INCR_MIN_CGU_SIZE : usize = 1800 ;
327
+ const NON_INCR_MIN_CGU_SIZE : usize = 500 ;
328
328
329
329
// Repeatedly merge the two smallest codegen units as long as:
330
330
// - we have more CGUs than the upper limit, or
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ fn instance_def_size_estimate<'tcx>(
459
459
match instance_def {
460
460
InstanceDef :: Item ( ..) | InstanceDef :: DropGlue ( ..) => {
461
461
let mir = tcx. instance_mir ( instance_def) ;
462
- mir. basic_blocks . iter ( ) . map ( |bb| bb . statements . len ( ) + 1 ) . sum ( )
462
+ mir. basic_blocks . len ( )
463
463
}
464
464
// Estimate the size of other compiler-generated shims to be 1.
465
465
_ => 1 ,
You can’t perform that action at this time.
0 commit comments