remainder loop was not vectorized: vectorization possible but seems inefficient
Cause:
The compiler only auto-vectorizes a loop if its internal heuristics indicate that a speed-up is likely. If a speed-up seems unlikely or is too uncertain, the compiler emits the message "vectorization possible but seems inefficient" and does not vectorize the loop. Common reasons for this include:
3. low iteration count.
These scenarios do not always prevent vectorization. The compiler takes into account the total amount of work in the loop, amongst other factors, when deciding whether vectorization is likely to be beneficial. Below are examples for all the scenarios:
Example:
subroutine d_15037_1(a, b, n, istride) real, intent(inout), dimension(n) :: a real, intent(in ), dimension(n) :: b integer, intent(in ) :: n, istride do i=1,n,istride a(i) = a(i) + b(i) enddo end subroutine d_15037_1
subroutine d_15037_2(a, b, c, ind, n) real, intent(out), dimension(n) :: a real, intent(in ), dimension(n) :: b, c integer, intent(in ), dimension(n) :: ind integer, intent(in ) :: n do i=1,n a(i) = b(ind(i)) + c(i) enddo end subroutine d_15037_2
subroutine d_15037_3(a, b, n) real, intent(inout), dimension(n) :: a real, intent(in ), dimension(n) :: b integer, intent(in ) :: n do i=1,3 a(i) = a(i) + b(i) enddo end subroutine d_15037_3
Resolution:
In this case, the compiler will not perform dependency analysis, and it is the programmer's responsibility to ensure that vectorization is safe.
Remainder loops:
remainder loop was not vectorized: vectorization possible but seems inefficient