Using PGO

To use profile-guided optimization, you must compile at least twice. Follow these steps:

  1. Instrumented compilation
    Compile using the /Qprof_gen option (-prof_gen on Linux*).

    Example: prompt>icl /Qprof_gen test.c

  2. Instrumented execution
    Run the application through a representative workload to generate a profile. This step generates a data file with a .dyn suffix.

    Example: prompt>test.exe

  3. Feedback compilation
    Set the compiler to use the profile information the next time you recompile the application, using the /Qprof_use option (-prof_use on Linux). This step uses the dynamic information (.dyn file) generated in the previous step. Besides the optimization, the compiler produces a pgopti.dpi file. You typically specify the default optimizations (/O2) for phase 1, and specify more advanced optimizations (/Qip or /Qipo) for phase 3.

    Example: prompt>icl /Qprof_use test.c