Skip to content

Document PGO policy regarding explicit user optimization hint behaviorΒ #58189

@AaronBallman

Description

@AaronBallman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PGOProfile Guided OptimizationsclangClang issues not falling into any other categorydocumentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions