-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
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.