Optimizer Report Generation

This topic discusses the optimization report compiler options, optimization phases, and typical report generation syntax.

Optimization Report Options

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-file

-opt-report-file

Generates an optimization report and directs it to a file specified in file. If the file is not in the local directory, supply the full path to the output file.

For more information, see the following topic:

/Qopt-report-level

-opt-report-level

Specifies the detail level of the optimization report. The min argument provides the minimal summary and max produces the full report. The default is min.

For more information, see the following topic:

/Qopt-report-phase

-opt-report-phase

Specifies the optimization phase to use when generating reports.

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. By default, the compiler generates reports for all routines.

For more information, see the following topic:

Optimization Report Usage

In general, use syntax similar to the following to generate optimization reports.

Platform

Sample Syntax

Linux

ifort -opt-report -opt-report-phase all myfile.f

Windows

ifort /Qopt-report /Qopt-report-phase all myfile.f

The command instructs the compiler to generate a report and send the results to stderr and specifies that the reports should include information about all available optimizers. Specifying a phase of all might generate too much information. 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.

Specifying Optimizations to Generate Reports

The compiler can generate reports for an optimizer you specify in the phase argument of the -opt-report-phase (Linux) or /Qopt-report-phase (Windows) option. Currently, the reports for the following optimizers are supported:

Optimizer Logical Name

High-level Optimizer Categories

ipo

Interprocedural Optimizer

ilo

Intermediate Language Scalar Optimizer

hlo

High-level Language Optimizer

ecg

ItaniumŪ Compiler Code Generator

pgo

Profile-Guided Optimizer

all

All phases

See IPO Reports, HLO Reports, and SWP Reports 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 ecg (Linux) or /Qopt-report-phase ipo /Qopt-report-phase ecg (Windows) the compiler generates reports from the interprocedural optimizer and the compiler code generator.

The following table shows the optimizations available by architecture.

Architecture

Supported Optimizers

Both IA-32 systems and ItaniumŪ-based systems

  • ilo and pgo

  • hlo: supported only if -O3 (Linux) or /O3 (Windows) option is specified.

  • ipo: supported only if interprocedural optimizer is invoked with -ip or -ipo (Linux) or /Qip or /Qipo (Windows).

  • all:  the above optimizers if -O3 (Linux) or /O3 (Windows) and -ip or -ipo (Linux) or /Qip or /Qipo (Windows) are specified.

ItaniumŪ-based systems only

  • all:  the above optimizers if -O3 (Linux) or /O3 (Windows) and -ip or -ipo (Linux) or /Qip or /Qipo (Windows) are specified

  • hlo and ipo: if either a hlo or ipo is specified, but the controlling option, -O3 (Linux) or /O3 (Windows) or -ip and -ipo (Linux) or /Qip and /Qipo (Windows), is not enabled, the compiler generates an empty report.

  • ecg

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 logical name. 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 Language Optimizer, loop unrolling

hlo_prefetch

High-level Language Optimizer, prefetching

ecg_swp

ItaniumŪ-based Compiler Code Generator, software pipelining

Enter -opt-report-help (Linux) or /Qopt-report-help (Windows) to list the logical names of optimizers and optimizations that are available for reporting.

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. For example, if -opt-report-phase ilo_co (Linux) or /Qopt-report-phase ilo_co (Windows) is specified, the compiler generates reports from both the constant propagation and the copy propagation optimizers.