Developer Directed Inline Expansion of User Functions

In addition to the options that support compiler directed inline expansion of user functions, the compiler also provides compiler options that allow you to more precisely direct when and if inline function expansion occurs.

The compiler measures the relative size of a routine in an abstract value of intermediate language units, which is approximately equivalent to the number of instructions that will be generated. The compiler uses the intermediate language unit estimates to classify routines and functions as relatively small, medium, or large functions. The compiler then uses the estimates to determine when to inline a function; if the minimum criteria for inlining is met and all other things are equal, the compiler has an affinity for inlining relatively small functions and not inlining relative large functions.

The following developer directed inlining options provide the ability to change the boundaries used by the inliningoptimizer to distinguish between small and large functions. These options are supported on IA-32, IntelŪ EM64T, and IntelŪ ItaniumŪ architectures.

Windows*

Linux*

Effect

/Qinline-forceinline

-inline-forceinline

Instructs the compiler to inline marked functions, if the inlining can be done safely. Typically, the compiler targets functions that have been marked for inlining based on the presence of directives, like DEC$ ATTRIBUTES FORCEINLINE, in the source code; however, the such directives in the source code are treated as suggestions for inlining. The option instructs the compiler to view the inlining suggestion as mandatory and inline the marked function if it can be done legally.

For more information, see the following topic:

/Qinline-min-size

-inline-min-size

Redefines the maximum size of small routines; routines that are equal to or smaller than the value specified are more likely to be inlined.

For more information, see the following topic:

/Qinline-max-size

-inline-max-size

Redefines the minimum size of large routines; routines that are equal to or larger than the value specified are less likely to be inlined.

For more information, see the following topic:

/Qinline-max-total-size

-inline-max-total-size

Limits the expanded size of inlined functions.

For more information, see the following topic:

/Qinline-max-per-routine

-inline-max-per-routine

Defines the number of times a called function can be inlined in each routine.

For more information, see the following topic:

/Qinline-max-per-compile

-inline-max-per-compile

Defines the number of times a called functions can be inlined in each compilation unit.

The compilation unit limit depends on the whether or not you specify the -ipo (Linux) or /Qipo (Windows) option. If you enable IPO, all source files that are part of the compilation are considered one compilation unit. For compilations not involving IPO each source file is considered an individual compilation unit.

For more information, see the following topic: