-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Introducing Profi into Rustc for better Sample PGO quality #156898
Copy link
Copy link
Open
Labels
A-PGOArea: Profile-guided optimizations (PGO)Area: Profile-guided optimizations (PGO)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-PGOArea: Profile-guided optimizations (PGO)Area: Profile-guided optimizations (PGO)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hi!
Profi is an algorithm for improving Sample PGO profile quality by clever heuristics (more details read in the Reference in "Profi implementation". This functionality is already implemented in LLVM and integrated into Clang's PGO pipeline. Rust is lacking such of functionality for now.
Clang has
-fsample-profile-use-profiflag. Clang already enabled using Profi default for Sample PGO use case 1 year.At the moment, Profi can still be used with Rust by passing an additional LLVM flag:
-Cllvm-args=-sample-profile-use-profibut I haven't tested it with Rustc yet.Open questions:
-fsample-profile-use-profi/-fno-sample-profile-use-profiinto the Rustc compiler?cargo-pgobut it's another discussion topic (especially sincecargo-pgodoesn't support Sample PGO flow).Some references:
-fsample-profile-use-profiflag into Clang: commit-fno-sample-profile-use-profiflag: PRKindly pinging @ojeda since that functionality could be interesting for their use case too (even if seems like Google uses another approach internally). Maybe this approach with flow-sensitive discriminators should be pushed instead? Especially since exactly this approach is used in Rust-for-Linux.
Thank you.