Diagnostic 15023: loop was not vectorized: unsupported loop structure


This vectorization message is emitted when there are multiple exit points from a given loop.  Below is an example for this scenario. Here the DO loop has a conditional in which it's possible to exit the loop early if the condition is met.  Because of this exit this loop is not a vectorization candidate.


program f15023
implicit none
real(8) :: a(16)=5.0
integer :: i

myloop: do i=1,16
         if ( a(i) /= 5.0 ) then
             print*, "error"
             exit myloop
         end if
         a(i) = a(i) * i
        end do myloop
end program f15023

$ ifort -vec-report2 f15023.f90
f15023.f90(6): (col. 1) remark: loop was not vectorized: unsupported loop structure

To get this loop to vectorize, consider if it is at all possible to recode the algorithm such that the EXIT is not needed.

Back to the list of vectorization diagnostics for Intel Fortran

For more complete information about compiler optimizations, see our Optimization Notice.