This topic discusses the compiler options related to creating optimization reports, typical report generation syntax, and optimization phases available for reporting.
The Intel® compiler provides the following options to generate and manage optimization reports:
Windows* |
Linux* |
Description |
---|---|---|
/Qopt-report |
-opt-report |
Generates an optimization report and directs it to stderr. By default, the compiler does not generate optimization reports. For more information, see the following topic:
|
/Qopt-report-phase |
-opt-report-phase |
Specifies the optimization phase to use when generating reports. See Specifying Optimizations to Generate Reports (below) for information about supported phases. For additional information, see the following topic:
|
/Qopt-report-file |
-opt-report-file |
Generates an optimization report and directs the report output to the specified file name. If the file is not in the local directory, supply the full path to the output file. This option overrides the opt-report option. For more information, see the following topic:
|
/Qopt-report-level |
-opt-report-level |
Specifies the detail level in the optimization report. The
min argument provides the minimal
summary and max produces the full report.
For more information, see the following topic:
|
/Qopt-report-routine |
-opt-report-routine |
Generates reports from all routines with names containing a string as part of their name; pass the string as an argument to this option. If not specified, the compiler will generate reports on all routines. For more information, see the following topic:
|
Use syntax similar to the following to generate optimization reports.
Platform |
Sample Syntax |
---|---|
Linux |
icc -opt-report -opt-report-phase all prog.cpp |
Windows |
icl /Qopt-report /Qopt-report-phaseall prog.cpp |
These example commands instruct the compiler to generate a report and send the results to stderr and specifies that the reports should include information about all available optimizers.
In most cases, specifying all as the phase will generate too much information to be useful.
If you want to capture the report in an output file instead of sending it to stderr, specify -opt-report-file (Linux) or /Qopt-report-file (Windows) and indicate an output file name. Specify -c (Linux) or /c (Windows) to instruct the compiler to not invoke the linker; the compiler stops after generating object code.
The compiler can generate reports for the optimizer you specify in the phase argument of the -opt-report-phase (Linux) or /Qopt-report-phase (Windows) option. The following optimizers are supported:
Optimizer Phase |
High-level Categories |
---|---|
all |
All phases |
ecg |
Itanium® Compiler Code Generator
|
hlo |
High-level Language Optimizer |
ilo |
Intermediate Language Scalar Optimizer |
ipo |
Interprocedural Optimizer |
pgo |
Profile-Guided Optimizer |
See Interprocedural Optimizations (IPO) Report, High-Level Optimization (HLO) Report, and Software Pipelining (SWP) Report for examples of using these optimization reports.
When one of the logical names is specified, as shown above, the compiler generates all reports from that optimizer. The option can be used multiple times on the same command line to generate reports for multiple optimizers. For example, for if you specified -opt-report-phase ipo -opt-report-phase hlo (Linux) or /Qopt-report-phase ipo /Qopt-report-phase hlo (Windows) the compiler generates reports from the interprocedural optimizer and the high-level optimizer code generator.
The following table shows the optimizations available by architecture.
Architecture |
Supported Optimizers |
---|---|
IA-32, IntelŪ EM64T, and ItaniumŪ-based systems |
|
ItaniumŪ-based systems only |
|
Each of the optimizer logical names supports many specific, targeted optimizations within them. However, each of the targeted optimizations have the prefix of the optimizer name. Enter -opt-report-help (Linux) or /Qopt-report-help (Windows) to list the names of optimizers that are supported. The following table lists some examples:
Optimizer optimization |
Description |
---|---|
ipo_inl |
Interprocedural Optimizer, inline expansion of functions |
ipo_cp |
Interprocedural Optimizer, constant propagation |
hlo_unroll |
High-level Optimizer, loop unrolling |
hlo_prefetch |
High-level Optimizer, prefetching |
ecg_swp |
Itanium®-based Compiler Code Generator, software pipelining |
The entire name for a particular optimization within an optimizer need not be fully specified; in many cases, the first few characters should suffice to generate reports. All optimization reports that have a matching prefix are generated.
In addition to the text-based optimization reports, the Intel® compiler can now generate the necessary information to allow the OptReport feature in Intel® VTune™ Linux 8.x to display the optimization reports graphically. See the VTune™ Performance Analyzer documentation for details.
To generate the graphical report display, you must do the following:
Set the VT_ENABLE_OPTIMIZATION_REPORT
environment variable to ON.
(This is an VTune™
Performance Analyzer environment setting, which is not required for the
compiler to generate text-based optimization reports.)
Compile the application using the following optimization reports options, at a minimum: -opt-report-phase and -opt-report-file.
As with the text-based reports, the graphical report information can be generated on all architectures; however, you can only view the graphical reports on IA-32 and Intel EM64T architectures.