Skip to content
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

Partial training option for PGO #63024

Open
pascua28 opened this issue May 31, 2023 · 2 comments
Open

Partial training option for PGO #63024

pascua28 opened this issue May 31, 2023 · 2 comments
Labels
PGO Profile Guided Optimizations

Comments

@pascua28
Copy link

pascua28 commented May 31, 2023

GCC introduced the -fprofile-partial-training flag which instructs the compiler not to optimize the cold paths for size. With this flag, the cold paths' optimization level will remain the same while optimizing the hot paths even more.

@pascua28 pascua28 changed the title PGO option for partial training Partial training option for PGO May 31, 2023
@EugeneZelenko EugeneZelenko added PGO Profile Guided Optimizations and removed new issue labels May 31, 2023
@sunnyflunk
Copy link

There is already -fno-profile-sample-accurate which I think is the equivalent behavior.

https://releases.llvm.org/16.0.0/tools/clang/docs/ClangCommandLineReference.html#cmdoption-clang-fprofile-sample-accurate

@HeXis-YS
Copy link

HeXis-YS commented Oct 7, 2023

Looks like -fno-profile-sample-accurate only works for sample profiles.
For instrumentation profile, you may want to try this.
Specifying --sparse=true when merging profdata removes functions records with 0 execution count, so that these functions can be optimized without profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PGO Profile Guided Optimizations
Projects
None yet
Development

No branches or pull requests

4 participants