Optimization and tuning
#pragma inline (C only), #pragma noinline
#pragma options (inline) (C only), #pragma options (noinline) (C only)
Attempts to inline functions instead of generating calls to those functions, for improved performance.
When the INLINE compiler option is in effect, the compiler places the code for selected subprograms at the point of call; this is called inlining. It eliminates the linkage overhead and exposes the entire inlined subprogram for optimization by the global optimizer.
When the NOINLINE compiler option is in effect, the compiler generates calls to functions instead of inlining functions.
.-NOINL-. >>-+-INL---+--+--------------------------------+----------------> '-(--+--------+--,--+----------+-' +-AUTO---+ +-REPORT---+ '-NOAUTO-' '-NOREPORT-' >--+-----------------------------------+----------------------->< '-,--+-----------+--,--+-------+--)-' '-threshold-' '-limit-'
NOINLINE
(AUTO,NOREPORT,
100,1000)
INLINE
(AUTO,NOREPORT,
100,1000)
NOINLINE
(AUTO,NOREPORT,
1000,8000)
INLINE
(AUTO,NOREPORT,
1000,8000)
For the c99, c89, cc, and c++ z/OS® UNIX System Services utilities, the default is NOINLINE(AUTO,NOREPORT,,).
For the z/OS UNIX utilities, when NOOPT is specified, the default is NOINLINE(AUTO,NOREPORT,100,1000). When OPT is specified, the default is INLINE(AUTO,NOREPORT,100,1000).
In the z/OS UNIX environment, specifying -V, when using the c89 or cc commands, will turn on the REPORT suboption of INLINE. The INLINE option itself is not touched (or changed) by -V.
For C only, if you specify NOAUTO the inliner only inlines those subprograms specified with the #pragma inline directive. The #pragma inline and #pragma noinline directives allow you to determine which subprograms are to be inlined and which are not when the INLINE option is specified. These #pragma directives have no effect if you specify NOINLINE. See z/OS XL C/C++ Language Reference for more information on #pragma directives.
The default is AUTO.
The default is NOREPORT.
You can specify the INLINE | NOINLINE option on the invocation line and for C in the #pragma options preprocessor directive. When you use both methods at the same time, the compiler merges the suboptions. If a suboption on the invocation line conflicts with a suboption in the #pragma options directive, the one on the invocation line takes precedence. If the NOINLINE option is specified on the invocation line and the #pragma options(inline) directive is used, the compiler will behave as if the INLINE option is specified. If the INLINE option is specified on the invocation line and the #pragma options(noinline) directive is used, the compiler will behave as if the INLINE option is specified.
For example, because you typically do not want to inline your subprograms when you are developing a program, you can use the #pragma options(noinline) directive. When you want to inline your subprograms, you can override the #pragma options(noinline) by specifying INLINE on the invocation line rather than by editing your source program. The following example illustrates these rules.
The INLINE option generates inlined code for the regular compiler object; therefore, it affects the IPA compile step only if you specify IPA(OBJECT). If you specify IPA(NOOBJECT), INLINE has no effect, and there is no reason to use it.
You can use the IPA Link control file inline and noinline directives to explicitly control the inlining of subprograms on the IPA link step. These directives override IPA compile step #pragma inline | noinline directives and inline subprogram specifiers.
The IPA inliner has the inlining capabilities of the compilation unit inliner. In addition, the IPA inliner detects complex recursion, and may inline it. If you specify the INLRPT option, the IPA Link listing contains the IPA Inline Report section. This section is similar to the report that the compilation unit inliner generates. If you specify NOINLINE(,REPORT,,) or NOINLINE INLRPT, IPA generates an IPA Inline Report section that specifies that nothing was inlined.
None.