Pipelining for ItaniumŪ-based Applications

The SWPdirective indicates preference for loops to be software pipelined. The directive does not help data dependency, but overrides heuristics based on profile counts or unequal control flow.

The syntax for this directive is shown below:

Syntax

!DEC$ SWP

The Software Pipelining optimization triggered by the SWP directive applies instruction scheduling to certain innermost loops, allowing instructions within a loop to be split into different stages, allowing increased instruction level parallelism.

This strategy can reduce the impact of long-latency operations, resulting in faster loop execution. Loops chosen for software pipelining are always innermost loops that do not contain procedure calls that are not 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 loop unrolling options).

You can view an optimization report to see whether software pipelining was applied (see Optimizer Report Generation).

The following example demonstrates on way of using the directive to instruct the compiler to attempt software pipeling.

Example: Using SWP

subroutine swp(a, b)

  integer :: i, a(100), b(100)

  !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

end subroutine swp

For more details on this directive, see "Directive Enhanced Compilation", section "General Directives", in the Intel® Fortran Language Reference.