Document PGO policy regarding explicit user optimization hint behavior #58189
Labels
clang
Clang issues not falling into any other category
documentation
PGO
Profile Guided Optimizations
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
orinline
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.
The text was updated successfully, but these errors were encountered: