Profile Guided OptimizationThis is a featured page

Recent versions of GCC support profile-guided optimization: the idea is you compile the program with "profiling" hooks inserted by the compiler, and then run the program on a reasonable data set. This produces profiling data about the program's performance (e.g. how often a given branch is taken), which can be used by the compiler to generate better code when the program is recompiled.

The idea would be to have a configure flag that would enable support for PGO, if supported by the compiler. To use PGO, the user would perhaps build a special Makefile target, which would:
  1. Compile/recompile the backend with profiling hooks
  2. Run the regression tests
  3. Recompile the backend to use the profiling data produced by #2

Neil C. implemented a primitive version of this idea earlier, but ran into some problems with the implementation of PGO in GCC 3.4. Presumably these have been fixed in GCC 4.1.

Actually getting this into the tree would depend in demonstrating that there is a real performance win to be gained from using PGO: getting benchmark data on PGO with typical PG workloads would be a useful first step.

Issues to consider:
  • Are the regression tests a representative set of input for PGO? If not, does it matter, and/or would another test workload be better? (e.g. pgbench)
  • What is the performance improvement to be gained from using PGO?
  • Should we support PGO only with GCC, or with other compilers as well? (Intel CC, MSVC++, etc.?)

Related links:

Interested hackers:
  • Neil Conway


No user avatar
neilc
Latest page update: made by neilc , Jun 22 2006, 7:16 PM EDT (about this update About This Update neilc Edited by neilc

4 words added

view changes

- complete history)
Keyword tags: None (edit keyword tags)
More Info: links to this page

Anonymous  (Get credit for your thread)


There are no threads for this page.  Be the first to start a new thread.