Basic PGO Options

This topic details the most commonly used options for profile-guided optimization.

The options listed below are used in the phases of the PGO. See Advanced PGO Options for options that extend PGO.

Windows*

Linux*

Effect

/Qprof-gen

/Qprof-genx

-prof-gen

-prof-genx

Instruments the program for profiling to get the execution count of each basic block. The option is used in phase 1 of PGO (generating instrumented code) to instruct the compiler to produce instrumented code in your object files in preparation for instrumented execution. Results in dynamic-information (.dyn) file.

With the x qualifier, the option gathers extra source  information, which enables using specific tools, like the proforder tool and the Code-coverage Tool.

If performing a parallel make, using this option will not affect it.

For more information, see the following topic:

/Qprof-use

-prof-use

Instruct the compiler to produce a profile-optimized executable and merges available dynamic-information (.dyn) files into a pgopti.dpi file. This option is used in used in phase 3 of PGO (generating a profile-optimized executable).

Note

The dynamic-information files are produced in phase 2 when you run the instrumented executable.

If you perform multiple executions of the instrumented program, this option merges the dynamic-information files again and overwrites the previous pgopti.dpi file.

For more information, see the following topic:

/Qprof-format-32

-prof-format-32

Using 32-bit Counters: This option has been deprecated in this release. The IntelŪ compiler, by default, produces profile data with 64-bit counters to handle large numbers of events in the .dyn and .dpi files.

Note

Mac OS*: This option is not supported.

This option produces 32-bit counters for compatibility with the earlier compiler versions. If the format of the .dyn and .dpi files is incompatible with the format used in the current compilation, the compiler issues the following message:

Error: xxx.dyn has old or incompatible file format - delete file and redo instrumentation compilation/execution.

The 64-bit format for counters and pointers in .dyn and .dpi files eliminate the incompatibilities on various platforms due to different pointer sizes.

For more information, see the following topic:

/Qfnsplit-

-fnsplit-

Disables function splitting. Function splitting is enabled by -prof-use (Linux*) or /Qprof-use (Windows*) in phase 3 to improve code locality by splitting routines into different sections: (1) one section to contain the cold or very infrequently executed code, and (2) one section to contain the rest of the code (hot code).

You may want to disable function splitting:

  • to get improved debugging capability. In the debug symbol table, it is difficult to represent a split routine, that is, a routine with some of its code in the hot code section and some of its code in the cold code section.

  • to disable function splitting when the profile data does not represent the actual program behavior, that is, when the routine is actually used frequently rather than infrequently.

Note

Windows* Only: This option behaves differently on IA-32 and ItaniumŪ-based systems.

Mac OS: This option is not supported.

IA-32 systems:

  • The option completely disables function splitting, placing all the code in one section.

ItaniumŪ-based systems:

  • The option disables the splitting within a routine but enables function grouping, an optimization in which entire routines are placed either in the cold code section or the hot code section.  Function grouping does not degrade debugging capability.

See an example of using PGO.

For more information, see the following topic: