Skip to content

Apply PGO to libstd on CI #97038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use stdlib PGO in stage 2
  • Loading branch information
Kobzol committed Jul 7, 2022
commit 6e0967f40a9dfeca8fbf14aed46904969b61d512
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