Tips to Encourage PGO

Consider the following when using PGO:

  • Minimize the changes to your program after instrumented execution and before feedback compilation. During feedback compilation, the compiler ignores dynamic information for functions modified after that information was generated.
  • Repeat the instrumentation compilation if you make many changes to your source files after execution and before feedback compilation.
  • PGO is most effective when you can properly define a representative workload.
  • Use PGO on applications with many functions, calls, or branches that are not loop-bound.
    Examples:
    • Databases,
    • Decision-support (enterprise),
    • MCAD Apps with computation spread throughout;
    • not confined to kernels

You can run PGO on different workloads. You can use the results in these ways:

  • merged by the compiler to produce a general-purpose binary
  • separately—use each workload to generate a special-purpose binary optimized for that workload