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

Document PGO policy regarding explicit user optimization hint behavior #58189

Open
AaronBallman opened this issue Oct 6, 2022 · 2 comments
Open
Labels
clang Clang issues not falling into any other category documentation PGO Profile Guided Optimizations

Comments

@AaronBallman
Copy link
Collaborator

We document PGO at https://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization but we do not document the behavior of PGO in the presence of user-provided optimization hints. It would be good to document how PGO handles conflicts between the hints the user explicitly wrote in their code and the profile they're optimizing against. For example, how do the following (non-exhaustive) hints behave: [[likely]] and other optimization attributes, register or inline use, __builtin_expect, etc.

This will help to set user expectations -- some users expect explicit optimization hints to be ignored by PGO while other users assume the hints are still honored (at least sometimes). If hints are honored, they should be clearly documented as doing so if that behavior is intentional.

@AaronBallman AaronBallman added clang:documentation PGO Profile Guided Optimizations labels Oct 6, 2022
@Endilll Endilll added documentation clang Clang issues not falling into any other category and removed clang:documentation labels Aug 15, 2023
@zamazan4ik
Copy link

@AaronBallman before we have the actual documentation in Clang, could you please write at least here - what is the current Clang/LLVM behavior in this case? It would be really interesting to know at least as a part of the GitHub issue.

If the current behavior is unknown, could we ping someone here to clarify the question?

@AaronBallman
Copy link
Collaborator Author

@AaronBallman before we have the actual documentation in Clang, could you please write at least here - what is the current Clang/LLVM behavior in this case? It would be really interesting to know at least as a part of the GitHub issue.

If the current behavior is unknown, could we ping someone here to clarify the question?

CC @bogner @dnovillo as LLVM code owners for profile data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category documentation PGO Profile Guided Optimizations
Projects
None yet
Development

No branches or pull requests

3 participants