Automatic mode assists you with starting to optimize your code.
It allows the compiler to choose potential functions to inline. The
compiler will inline all routines that are less than the threshold in
abstract code units (ACUs) until the function that the functions are
inlined into is greater than limit abstract code units. The threshold and limit parameters
are defined as follows:
- threshold
- Maximum relative size of a function to inline. The default
value is 100 Abstract Code Units (ACUs), both for C and C++. ACUs
are proportional in size to the executable code in the function; your
code is translated into ACUs by the compiler. Specifying a threshold
of 0 is equivalent to specifying NOAUTO. Note that the
proportion of ACUs to executable code in a function is different under
IPA.
- limit
- Maximum relative size a function can grow before auto-inlining
stops. The default is 1000 ACUs for the specific function. Specifying
a limit of 0 is equivalent to specifying NOAUTO.
Note: When functions become too large, runtime performance
can degrade.
Under the z/OS® UNIX shell, to provide assistance in choosing which
routines to inline, use the c89 -W command
to pass the INLRPT option to the z/OS XL C/C++ compiler. At NOOPT,
you will also need to specify the INLINE option. The default
at NOOPT is NOINLINE.
For example, at NOOPT, to get INLINE(AUTO,REPORT,100,1000) for
a C program, use one of the following c89 commands:
c89 -W "0,inline(,REPORT,,)" example.c
c89 -W "0,inline,inlrpt" example.c
You can get the same value at OPT for a C program passing the INLRPT
option to the z/OS XL C/C++ compiler as follows:
c89 -2 -W "0,inlrpt"
Note: Inlining debugging functions or functions that are
rarely invoked can degrade performance. Use the
#pragma
noinline directive to instruct the automatic inliner to not inline
these types of functions. The
#pragma inline and
the
#pragma noinline directives and the
inline keyword
are honored by automatic inlining regardless of the
limit and
threshold you have specified. For more information,
see
inline in
z/OS XL C/C++ Language Reference.