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> {
6161 MonoItem :: Fn ( instance) => {
6262 // Estimate the size of a function based on how many statements
6363 // it contains.
64- tcx. instance_def_size_estimate ( instance. def )
64+ 1 + tcx. instance_def_size_estimate ( instance. def )
6565 }
6666 // Conservatively estimate the size of a static declaration
6767 // or assembly to be 1.
Original file line number Diff line number Diff line change @@ -322,9 +322,9 @@ fn merge_codegen_units<'tcx>(
322322 // Having multiple CGUs can drastically speed up compilation. But for
323323 // non-incremental builds, tiny CGUs slow down compilation *and* result in
324324 // 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
326326 // 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 ;
328328
329329 // Repeatedly merge the two smallest codegen units as long as:
330330 // - 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>(
459459 match instance_def {
460460 InstanceDef :: Item ( ..) | InstanceDef :: DropGlue ( ..) => {
461461 let mir = tcx. instance_mir ( instance_def) ;
462- mir. basic_blocks . iter ( ) . map ( |bb| bb . statements . len ( ) + 1 ) . sum ( )
462+ mir. basic_blocks . len ( )
463463 }
464464 // Estimate the size of other compiler-generated shims to be 1.
465465 _ => 1 ,
You can’t perform that action at this time.
0 commit comments