Skip to content

Commit 8b81ee4

Browse files
committed
Auto merge of #65052 - ishitatsuyuki:no-inline-cgu, r=<try>
[perf] Disable inline_in_all_cgus when LTO is enabled I tried to run lolbench with this flag altered; however lolbench either errored or got stuck, so I end up running only 3 of the benchmarks manually. One showed no changes, another one showed 20% perf improvement somehow, and another showed slight (1%) regression. So I'm thinking of benchmarking it with perf instead; if we still have ThinLTO on CI then we can measure stage2 compiler performance as a metric of how much it affects generated code.
2 parents 0221e26 + 5da9200 commit 8b81ee4

File tree

1 file changed

+2
-2
lines changed
  • src/librustc_mir/monomorphize

1 file changed

+2
-2
lines changed

src/librustc_mir/monomorphize/item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc::hir::def_id::LOCAL_CRATE;
22
use rustc::mir::mono::MonoItem;
3-
use rustc::session::config::OptLevel;
3+
use rustc::session::config::{OptLevel, Lto};
44
use rustc::ty::{self, TyCtxt, Instance};
55
use rustc::ty::subst::InternalSubsts;
66
use rustc::ty::print::obsolete::DefPathBasedNames;
@@ -65,7 +65,7 @@ pub trait MonoItemExt<'tcx>: fmt::Debug {
6565
fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode {
6666
let inline_in_all_cgus =
6767
tcx.sess.opts.debugging_opts.inline_in_all_cgus.unwrap_or_else(|| {
68-
tcx.sess.opts.optimize != OptLevel::No
68+
tcx.sess.opts.optimize != OptLevel::No && if tcx.sess.lto() == Lto::No
6969
}) && !tcx.sess.opts.cg.link_dead_code;
7070

7171
match *self.as_mono_item() {

0 commit comments

Comments
 (0)