Inlining

Inlining is the process of replacing a subroutine or function call at the call site with the body of the subroutine or function being called. This eliminates call-linkage overhead and can expose significant optimization opportunities.

For example, with inlining, the compiler can replace the subroutine parameters in the function body with the actual arguments passed. Inlining trade-offs can include code bloat and an increase in the difficulty of debugging your source code.

If your application contains many calls to small procedures, the procedure call overhead can sometimes increase the execution time of the application considerably. Specifying the -qinline compiler option can reduce this overhead. Additionally, you can use the -p or -pg options and profiling tools to determine which subprograms your application calls most frequently, and use -qinline to list their names to ensure inlining.

The -qinline option can perform inlining where the calling and called procedures are in different compilation units. This applies to optimization level -O5 only.
# Let the compiler decide what to inline.
xlf95 -O3 -qinline inline.f

# Encourage the compiler to inline particular subprograms.
xlf95 -O3 -qinline+called_100_times:called_1000_times inline.f
Note: -qipa=inline is deprecated and no longer supported; it is replaced by -qinline. For details, see the Deprecated options section in the XL Fortran Compiler Reference.