Loop Count and Loop Distribution

LOOP COUNT (N) Directive

The LOOP COUNT (n) directive indicates the loop count is likely to be n, where n is an integer constant.

The value of loop count affects heuristics used in software pipelining, vectorization and loop-transformations.

!DEC$ LOOP COUNT (10000)
do i =1,m
b(i) = a(i) +1 ! This is likely to enable
! the loop to get software-
! pipelined
enddo

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

Loop Distribution Directive

The DISTRIBUTE POINT directive indicates a preference of performing loop distribution.

Loop distribution may cause large loops be distributed into smaller ones. This may enable more loops to get software-pipelined. If the directive is placed inside a loop, the distribution is performed after the directive and any loop-carried dependency is ignored. If the directive is placed before a loop, the compiler will determine where to distribute and data dependency is observed. Currently only one distribute directive is supported if it is placed inside the loop.

!DEC$ DISTRIBUTE POINT
do i =1, m
b(i) = a(i) +1
....
c(i) = a(i) + b(i) ! Compiler will decide where
 ! to distribute.
 ! Data dependency is observed
....
d(i) = c(i) + 1
enddo

do i =1, m
b(i) = a(i) +1
....
!DEC$  DISTRIBUTE POINT
call  sub(a, n)    ! Distribution will start here,
 ! ignoring all loop-carried
 ! dependency
c(i) = a(i) + b(i)
....
d(i) = c(i) + 1
enddo

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