Diagnostic 15003: PARTIAL LOOP WAS VECTORIZED (Fortran)

Cause:

This message is emitted when only part of the loop body is vectorized. The loop is distributed (divided) into two loops, one of which is vectorized and one of which is not.

Example:

subroutine d_15003(a,b,n)
  implicit none
  integer, intent(out), dimension(n) :: a,b
  integer, intent(in )               :: n
  integer                            :: i,j

  j=1
  do i=1,n
     a(i) = i
     b(i) = j
     j = mod(j+1,12)
  enddo

end subroutine d_15003

ifort -c -vec-report2 d_15003_1.f90

d_15003_1.f90(8): (col. 3) remark: PARTIAL LOOP WAS VECTORIZED
d_15003_1.f90(8): (col. 3) remark: loop was not vectorized: existence of vector dependence
 

Additional information:

You can see how the compiler split up the loop by looking at the optimization report:

ifort -c -vec-report2 d_15003_1.f90 -opt-report-phase hlo

d_15003_1.f90(8): (col. 3) remark: PARTIAL LOOP WAS VECTORIZED
d_15003_1.f90(8): (col. 3) remark: loop was not vectorized: existence of vector dependence
.....
High Level Optimizer Report (d_15003_)
LOOP DISTRIBUTION in d_15003_ at line 8
LOOP DISTRIBUTION in d_15003_ at line 8
LOOP DISTRIBUTION in d_15003_ at line 8
 

The generated code is equivalent to the following:

subroutine d_15003(a,b,n)
  implicit none
  integer, intent(out), dimension(n) :: a,b
  integer, intent(in )               :: n
  integer                            :: i,j

  j=1
  do i=1,n
     a(i) = i
  enddo     
  do i=1,n
     b(i) = j
     j = mod(j+1,12)
  enddo

end subroutine d_15003
ifort -c -vec-report3 d_15003_2.f90
d_15003_2.f90(8): (col. 3) remark: LOOP WAS VECTORIZED
d_15003_2.f90(11): (col. 3) remark: loop was not vectorized: existence of vector dependence
d_15003_2.f90(13): (col. 6) remark: vector dependence: assumed ANTI dependence between j line 13 and j line 13
d_15003_2.f90(13): (col. 6) remark: vector dependence: assumed FLOW dependence between j line 13 and j line 13
d_15003_2.f90(13): (col. 6) remark: vector dependence: assumed FLOW dependence between j line 13 and j line 12
d_15003_2.f90(12): (col. 6) remark: vector dependence: assumed ANTI dependence between j line 12 and j line 13
 

The second loop is not vectorized because the statement j=mod(j+1,12) introduces a dependency between loop iterations.

Back to the list of vectorization diagnostics for Intel Fortran

Einzelheiten zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.