Pass BOLT settings at the correct step
This commit is contained in:
parent
9a0e90f7b4
commit
482a8204bc
@ -907,7 +907,7 @@ impl Step for Rustc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if builder.build.config.enable_bolt_settings && compiler.stage == 1 {
|
if builder.build.config.enable_bolt_settings && compiler.stage == 1 {
|
||||||
// Relocations are required for BOLT to work.k
|
// Relocations are required for BOLT to work.
|
||||||
cargo.env("RUSTC_BOLT_LINK_FLAGS", "1");
|
cargo.env("RUSTC_BOLT_LINK_FLAGS", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,12 @@ fn execute_pipeline(
|
|||||||
print_free_disk_space()?;
|
print_free_disk_space()?;
|
||||||
|
|
||||||
stage.section("Build PGO optimized rustc", |section| {
|
stage.section("Build PGO optimized rustc", |section| {
|
||||||
Bootstrap::build(env).rustc_pgo_optimize(&profile).run(section)
|
let mut cmd = Bootstrap::build(env).rustc_pgo_optimize(&profile);
|
||||||
|
if env.use_bolt() {
|
||||||
|
cmd = cmd.with_rustc_bolt_ldflags();
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd.run(section)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
Ok(profile)
|
Ok(profile)
|
||||||
@ -259,7 +264,6 @@ fn execute_pipeline(
|
|||||||
stage.section("Build PGO optimized LLVM", |stage| {
|
stage.section("Build PGO optimized LLVM", |stage| {
|
||||||
Bootstrap::build(env)
|
Bootstrap::build(env)
|
||||||
.with_llvm_bolt_ldflags()
|
.with_llvm_bolt_ldflags()
|
||||||
.with_rustc_bolt_ldflags()
|
|
||||||
.llvm_pgo_optimize(&llvm_pgo_profile)
|
.llvm_pgo_optimize(&llvm_pgo_profile)
|
||||||
.avoid_rustc_rebuild()
|
.avoid_rustc_rebuild()
|
||||||
.run(stage)
|
.run(stage)
|
||||||
@ -270,7 +274,7 @@ fn execute_pipeline(
|
|||||||
|
|
||||||
log::info!("Optimizing {llvm_lib} with BOLT");
|
log::info!("Optimizing {llvm_lib} with BOLT");
|
||||||
|
|
||||||
// FIXME(kobzol: try gather profiles together, at once for LLVM and rustc
|
// FIXME(kobzol): try gather profiles together, at once for LLVM and rustc
|
||||||
// Instrument the libraries and gather profiles
|
// Instrument the libraries and gather profiles
|
||||||
let llvm_profile = with_bolt_instrumented(&llvm_lib, |llvm_profile_dir| {
|
let llvm_profile = with_bolt_instrumented(&llvm_lib, |llvm_profile_dir| {
|
||||||
stage.section("Gather profiles", |_| {
|
stage.section("Gather profiles", |_| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user