Interprocedural Analysis (IPA) Optimization Options

Interprocedural analysis includes a set of compiler techniques that examine an entire program, as opposed to a single function, to increase the opportunity for optimization, particularly when a program uses many, frequently called functions.

Interprocedural analysis includes a set of compiler techniques that examine an entire program, as opposed to a single function, to increase the opportunity for optimization, particularly when a program uses many, frequently called functions.

Inlining/cloning transforms code in ways that increase the opportunity for optimization. The user controls inlining/cloning through the use of command line options. If the user desires more fine grained control, directives may be placed within the code. By default, the compiler will attempt inlining/cloning where it deems beneficial. Inlining/cloning may increase object code size.

-h ipalevel , -O ipalevel

Default: -h ipa3

Specifies the level of interprocedural optimization (IPA). level may be one of the following values, and includes functionality of previous non-zero levels:
0
All inlining and cloning is disabled. All inlining and cloning compiler directives are ignored.
1
Directive IPA. Inlining/cloning is attempted for call sites and routines that are under the control of a compiler directive. See Inline and Clone Directives.
2
Inlining. Inline a call site to an arbitrary depth as long as the expansion does not exceed some compiler-determined threshold. The call site must flatten for any expansion to occur. The call site is said to "flatten" when there are no calls present in the expanded code. The call site must reside within the body of a loop and the entire loop body must flatten. A loop body is said to "flatten" when all call sites within the body of the loop are flattened. Includes level 1.
3
(Default) Inlining and cloning. Includes level 1 and 2. Plus, constant actual argument inlining and tiny routine inlining.
4
Cloning and aggressive inlining. This includes levels 1, 2, and 3. Additionally, a call site does not have to reside in a loop body to inline; nor does the call site have to necessarily flatten to inline.
5
Aggressive inlining and aggressive cloning. Includes levels 1, 2, 3, and 4.

-O ipafrom=source[:source]...

The -O ipafrom=source[:source] option explicitly indicates the functions to consider for inlining/cloning. The source arguments identify each file or directory that contains the functions to consider for inlining/cloning. Spaces are not allowed on either side of the equal sign.

All inlining directives are recognized at -Oipa levels > 1.

For information about inlining directives, see Cray Fortran Directive Use.

Note that the routines in source are not actually linked with the final program. They are simply templates for the inliner. To have a routine contained in source linked with the program, include it in an input file to the compilation.

Use one or more of the objects described in the File Types table in the source argument.

Table 1. File Types
Fortran source filesThe routines in Fortran source files are candidates for inline expansion and must contain error-free code. Source files that are acceptable for inlining are files that have one of the following extensions: .f, .F, .f90, .F90, .f95, .F95, .f03, .F03, .f08, .F08, .ftn, .FTN, .for, or .FOR.
Module filesWhen compiling with -em and -Omodinline is in effect, the precompiled module information is written to modulename.mod. The compiler writes a modulename.mod file for each module; modulename is created by taking the name of the module and, if necessary, converting it to uppercase.
dirA directory that contains any of the file types described in this table.

Combined inlining is invoked by specifying the -O ipan and -O ipafrom= options on the command line. This inlining mode will look only in source for potential targets for expansion, while applying the selected level of inlining heuristics specified by the -O ipan option.

-O [no]modinline, -h [no]modinline

Default: -O modinline

Same as the -h modinline option. The -O modinline option prepares module procedures so they can be inlined by directing the compiler to create templates for module procedures encountered in a module. These templates are attached to file.o or modulename.mod. The files that contain these inlinable templates can be saved and used later to inline call sites within a program being compiled.

When -e m is in effect, module information is stored in modname.mod. The compiler writes a modulename.mod file for each module; modulename is created by taking the name of the module and, if necessary, converting it to uppercase.

The process of inlining module procedures requires only that file.o or modulename.mod be available during compilation through the typical module processing mechanism. The USE statement makes the templates available to the inliner. There is no need to specify the file.o or modulename.mod with the -O ipafrom option.

When -O modinline is specified, the MODINLINE and NOMODINLINE directives are recognized. Using the -O modinline option increases the size of file.o.

To ensure that file.o is not removed, specify this option in conjunction with the -c option. For information about the -c option, see -c.