inlinealways

Date:

01-09-2012

NAME

inline_always, INLINEALWAYS, inline_never, INLINENEVER - specifies functions or procedures that the compiler should attempt to inline or avoid inlining

SYNOPSIS

#pragma _CRI inline_always name [,name ] ...
#pragma _CRI inline_never name [,name ] ...
!DIR$ INLINEALWAYS name[, name] ...

!DIR$ INLINENEVER name[, name] ...
name

the name of a function or procedure

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

These directives behave similarly in both C/C++ and Fortran. The C/C++ directive names are used below to explain their behaviors.

The inline_always directive specifies functions that the compiler should always attempt to inline. If the directive is placed in the definition of the function, inlining is attempted at every call site to name in the entire input file being compiled. If the directive is placed in a function other than the definition, inlining is attempted at every call site to name within the specific function containing the directive.

The inline_never directive specifies functions that should not be inlined. If the directive is placed in the definition of the function, inlining is never attempted at any call site to name in the entire input file being compiled. If the directive is placed in a function other than the definition, inlining is never attempted at any call site to name within the specific function containing the directive.

An error message is issued if inline_never and inline_always are specified for the same procedure in the same program unit.

EXAMPLES

Example 1: INLINESALWAYS and INLINENEVER

The following file in Fortran is compiled with -O ipa1 option.

SUBROUTINE S()
!DIR$ INLINEALWAYS S ! THIS SAYS ATTEMPT
! INLINING OF S AT ALL CALLS.
...
END SUBROUTINE
SUBROUTINE T
!DIR$ INLINENEVER S ! DO NOT INLINE ANY CALLS TO S
! IN SUBROUTINE T.
CALL S()
...
END SUBROUTINE
SUBROUTINE V
!DIR$ NOINLINE ! HAS HIGHER PRECEDENCE THAN INLINEALWAYS.
CALL S() ! DO NOT INLINE THIS CALL TO S.
!DIR$ INLINE
CALL S() ! ATTEMPT INLINING OF THIS CALL TO S.
...
END SUBROUTINE
SUBROUTINE W
CALL S() ! ATTEMPT INLINING OF THIS CALL TO S.
...
END SUBROUTINE

SEE ALSO

inline(7), intro_directives(7)