Closed
Description
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.