SWP and NOSWP (i64 only)

General Compiler Directives: SWP enables software pipelining for a DO loop. NOSWP (the default) disables this software pipelining. These directives are only available on IA-64 processors.

Syntax

cDEC$ SWP
cDEC$ NOSWP


c
Is one of the following: C (or c), !, or *. (See Syntax Rules for Compiler Directives.)

Description

The SWP directive must precede the DO statement for each DO loop it affects.

The SWP directive does not help data dependence, but overrides heuristics based on profile counts or lop-sided control flow.

The software pipelining optimization specified by the SWP directive applies instruction scheduling to certain innermost loops, allowing instructions within a loop to be split into different stages.

This allows increased instruction level parallelism, which can reduce the impact of long-latency operations, resulting in faster loop execution.

Loops chosen for software pipelining are always innermost loops containing procedure calls that are inlined. Because the optimizer no longer considers fully unrolled loops as innermost loops, fully unrolling loops can allow an additional loop to become the innermost loop (see compiler option -funroll-loops or /Qunroll).

You can request and view the optimization report to see whether software pipelining was applied.

See Also

Rules for General Directives that Affect DO Loops, Optimizing Applications: Pipelining for ItaniumŪ-based Applications, Optimizing Applications: Optimizer Report Generation, unroll compiler option

Example

!DEC$ SWP
  do i = 1, m
    if (a(i) .eq. 0) then
      b(i) = a(i) + 1
    else
      b(i) = a(i)/c(i)
    endif
  enddo