Use -Zinline-mir instead of -Zmir-opt-level=3

Except for mir inlining all mir opts that are beneficial for cg_clif now
run on -Zmir-opt-level=2. -Zmir-opt-level=3 enables some more expensive
optimizations.
This commit is contained in:
bjorn3 2023-06-19 17:21:30 +00:00
parent 8b23094ade
commit 0b3060138b

View File

@ -251,7 +251,10 @@ fn build_clif_sysroot_for_triple(
rustflags
.push_str(&format!(" --sysroot {}", RTSTARTUP_SYSROOT.to_path(dirs).to_str().unwrap()));
if channel == "release" {
rustflags.push_str(" -Zmir-opt-level=3");
// Incremental compilation by default disables mir inlining. This leads to both a decent
// compile perf and a significant runtime perf regression. As such forcefully enable mir
// inlining.
rustflags.push_str(" -Zinline-mir");
}
compiler.rustflags += &rustflags;
let mut build_cmd = STANDARD_LIBRARY.build(&compiler, dirs);