Intel® Fortran Compiler 18.0 Developer Guide and Reference

ATTRIBUTES OPTIMIZATION_PARAMETER

The ATTRIBUTES directive option OPTIMIZATION_PARAMETER passes certain information about a procedure or main program to the optimizer.

Syntax

!DIR$ ATTRIBUTES OPTIMIZATION_PARAMETER: string::{ procedure-name | named-main-program}

string

Is a character constant that is passed to the optimizer. The constant must be delimited by apostrophes or quotation marks, and it may have one of the following values:

  • TARGET_ARCH= cpu

    Tells the compiler to generate code specialized for a particular processor. For the list of cpus you can specify, see option [Q]x.

  • G2S = {ON | OFF}

    Disables or enables the use of gather/scatter instructions in the specified program unit.

    ON tells the optimizer to disable the generation of gather/scatter and to transform gather/scatter into unit-strided loads/stores plus a set of shuffles wherever possible.

    OFF tells the optimizer to enable the generation of gather/scatter instructions and not to transform gather/scatter into unit-strided loads/stores.

  • INLINE_MAX_PER_ROUTINE= n

    Specifies the maximum number of times the inliner may inline into the procedure. The n is one of the following:

    • A non-negative scalar integer constant (>=0) that specifies the maximum number of times the the inliner may inline into the procedure. If you specify zero, no inlining is done into the routine.

    • The keyword UNLIMITED, which means that there is no limit to the number of times the inliner may inline into the procedure.

    For more information, see option [Q]inline-max-per-routine.

  • INLINE_MAX_TOTAL_SIZE= n

    Specifies how much larger a routine can normally grow when inline expansion is performed. The n is one of the following:

    • A non-negative scalar integer constant (>=0) that specifies the permitted increase in the routine's size when inline expansion is performed. If you specify zero, no inlining is done into the routine.

    • The keyword UNLIMITED, which means that there is no limit to the size a routine may grow when inline expansion is performed.

    For more information, see option [Q]inline-max-total-size.

procedure-name

Is the name of a procedure.

named-main-program

Is the name of a main program

Description

The characters in string can appear in any combination of uppercase and lowercase. The following rules also apply to string:

You can specify multiple ATTRIBUTES OPTIMIZATION_PARAMETER directives for one procedure or one main program.

For the named procedure or main program, the values specified for ATTRIBUTES OPTIMIZATION_PARAMETER override any settings specified for the following compiler options:

Example

Consider the two attributes optimization_parameter directives in the following code:

function f (x)
!dir$ attributes optimization_parameter: “inline_max_per_routine=10” :: f
!dir$ attributes optimization_parameter: “inline_max_total_size=2000” :: f
real :: f, x
…

The two directives have the same effect as if the function F had been complied with "/Qinline-max-per-routine:10 /Qinline-max-total-size:2000" on Windows* or with "-inline-max-per-routine=10 -inline-max-total-size=2000" on Linux* or macOS*, that is, inlining will not increase the size of F by more than 2000 and the inliner will not inline routines into F more than 10 times.

See Also