Skip to content

Commit

Permalink
Use stdlib PGO in stage 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Jul 7, 2022
1 parent 1ee57ce commit 6e0967f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ impl Step for Std {
}

let is_collecting = if let Some(path) = &builder.config.libstd_profile_generate {
if compiler.stage == 1 {
if compiler.stage == 2 {
eprintln!("STD STAGE 2 GENERATE");
cargo.env("RUST_LIBSTD_PGO", "1");
cargo.rustflag(&format!("-Cprofile-generate={}", path));
// Apparently necessary to avoid overflowing the counters during
Expand All @@ -126,7 +127,8 @@ impl Step for Std {
false
}
} else if let Some(path) = &builder.config.libstd_profile_use {
if compiler.stage == 1 {
if compiler.stage == 2 {
eprintln!("STD STAGE 2 USE");
cargo.rustflag(&format!("-Cprofile-use={}", path));
cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
true
Expand Down

0 comments on commit 6e0967f

Please sign in to comment.