Skip to content

Add Profile-Guided Optimization (PGO) support to the Flang compiler #74216

Closed
@zamazan4ik

Description

@zamazan4ik

Similar to Clang, we need to support Profile-Guided Optimization (PGO) in Flang too. Use cases for having this optimization are completely the same as we have for Clang right now - have an ability to optimize better Fortran code based on the runtime information.

I propose adding the following PGO types for Flang:

  • IR PGO (-fprofile-generate/-fprofile-use options in Clang)
  • CS PGO (fcs-profile-generate in Clang). This option would be a good addition to IR PGO
  • Sampling PGO (AutoFDO + -fprofile-sample-use option in Clang). Having sampling PGO support is important if we want to collect PGO profiles directly from a production environment.

I think there is no need to implement FE PGO (-fprofile-instr-generate/-fprofile-instr-use options in Clang) in Flang since IR PGO is a better option according to the issue.

As a reference, the Clang PGO docs can be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PGOProfile Guided OptimizationsflangFlang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions