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 inlining optimizer to distinguish between small and large functions. These options are supported on IA-32, Intel® 64, and IA-64 architectures.
In general, you should use the -inline-factor (Linux* and Mac OS* X) and /Qinline-factor (Windows*) option before using the individual inlining options listed below; this single option effectively controls several other upper-limit options.
Linux* and Mac OS* X |
Windows* |
Effect |
---|---|---|
Controls the multiplier applied to all inlining options that define upper limits: inline-max-size, inline-max-total-size, inline-max-per-routine, and inline-max-per-compile. While you can specify an individual increase in any of the upper-limit options, this single option provides an efficient means of controlling all of the upper-limit options with a single command. By default, this option uses a multiplier of 100, which corresponds to a factor of 1. Specifying 200 implies a factor of 2, and so on. Experiment with the multiplier carefully. You could increase the upper limits to allow too much inlining, which might result in your system running out of memory. For more information, see the following topic:
|
||
Instructs the compiler to force inlining of functions suggested for inlining whenever the compiler is capable doing so. Typically, the compiler targets functions that have been marked for inlining based on the presence of keywords, like __forceinline, in the source code; however, all such directives in the source code are treated only 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:
|
||
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:
|
||
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:
|
||
Limits the expanded size of inlined functions. For more information, see the following topic:
|
||
Limits the number of times inlining can be applied within a routine. For more information, see the following topic:
|
||
Limits the number of times inlining can be applied within a compilation unit. The compilation unit limit depends on the whether or not you specify the -ipo (Linux and Mac OS X) 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:
|