Product Version: Intel® Fortran Compiler 15.0 and above
The vectorization report generated using Visual Fortran Compiler's optimization and vectorization report options -O2 -Qvec-report2 -Qopt-report:2 states that loop was not vectorized: vectorization possible but seems inefficient.
An example below will generate the following remark in optimization report:
subroutine foo(a, b, n) implicit none integer, intent(in) :: n real, intent(inout) :: a(n) real, intent(out) :: b real :: x = 0 integer :: i do i=1,n x = x + a(2*i) end do b = x end subroutine foo
ifort -c /O2 /Qopt-report:2 /Qopt-report-phase:vec /Qopt-report-file:stdout f15335.f90
Report from: Vector optimizations [vec]
LOOP BEGIN at f15335.f90(9,5)
remark #15335: loop was not vectorized: vectorization possible but seems inefficient. Use vector always directive or /Qvec-threshold0 to override
Using !DEC$ VECTOR ALWAYS directive in the code will vectorize the loop by overriding efficiency heuristics of the vectorizer.
VECTOR and NOVECTOR
Product and Performance Information
Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.