Profile Guided Optimization

Main purpose of profile guided optimization is to re-order instructions in an optimal way. Profile-Guided Optimization consists of three phases (or steps):

  1. Generating instrumented code by compiling with the -prof-gen[x] option when creating the instrumented executable.
  2. Running the instrumented executable, which produces dynamic-information (.dyn) files.
  3. Compiling the application using the profile information using the -prof-use.

The figure illustrates the phases and the results of each phase.

PGO Gif

See also: