Technical data

Cray Standard C/C++ Reference Manual
/* directive will cause incorrect code due to dependencies! */
#pragma _CRI unroll 2
for (i = 0; i < 10; i++) {
for (j = 1; j < 100; j++) {
a[i][j] = a[i+1][j-1] + 1;
}
}
3.11 Inlining Directives
Inlining replaces calls to user-defined functions with the code in the calling
process that represents the function. This can improve performance by saving
the expense of the function call overhead. It also enhances the possibility of
additional code optimization and vectorization, especially if the function call was
an inhibiting factor.
Inlining is invoked in the following ways:
Automatic inlining of an entire compilation is enabled by issuing the
-h inline command line option, as described in Section 2.12.1, page 22.
Inlining of particular function calls is specified by the inline directive, as
discussed in the following sections.
Inlining directives can appear in global scope (that is, not inside a function
definition). Global inlining directives specify whether all calls to the specified
functions should be inlined (inline or noinline).
Inlining directives can also appear in local scope; that is, inside a function
definition. A local inlining directive applies only to the next call to the function
specified on the directive. Although the function specified on an inlining
directive does not need to appear in the next statement, a call to the function
must occur before the end of the function definition.
Inlining directives always take precedence over the automatic inlining requested
on the command line. This means that function calls that are associated with
inlining directives are inlined before any function calls selected to be inlined by
automatic inlining.
Note: A function that contains a variable length array declaration is not
currently inlined.
The -h report=i option writes messages identifying where functions are
inlined or briefly explains why functions are not inlined.
100 S217936