diff --git a/build_system/build_sysroot.rs b/build_system/build_sysroot.rs index 74bba9ed5eb..2c8da62fb05 100644 --- a/build_system/build_sysroot.rs +++ b/build_system/build_sysroot.rs @@ -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);