Skip to content

Commit 0b30601

Browse files
committed
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.
1 parent 8b23094 commit 0b30601

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build_system/build_sysroot.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ fn build_clif_sysroot_for_triple(
251251
rustflags
252252
.push_str(&format!(" --sysroot {}", RTSTARTUP_SYSROOT.to_path(dirs).to_str().unwrap()));
253253
if channel == "release" {
254-
rustflags.push_str(" -Zmir-opt-level=3");
254+
// Incremental compilation by default disables mir inlining. This leads to both a decent
255+
// compile perf and a significant runtime perf regression. As such forcefully enable mir
256+
// inlining.
257+
rustflags.push_str(" -Zinline-mir");
255258
}
256259
compiler.rustflags += &rustflags;
257260
let mut build_cmd = STANDARD_LIBRARY.build(&compiler, dirs);

0 commit comments

Comments
 (0)