Product Version: Intel(R) Visual Fortran Compiler XE 15.0.0.070
Cause:
The vectorization report generated when using Visual Fortran Compiler's optimization options (-O2 -Qopt-report:2 -traceback -check:bounds -check:nostack) states that loop was not vectorized due to compile time constraints.
Example:
An example below will generate the following remark in optimization report:
subroutine foo (a,n) implicit none interface function bar(n) integer :: bar integer, intent(in) :: n end function bar end interface integer, intent(in) :: n real,intent(inout) :: a(n) integer :: i do i=1, bar(i) a(i) = 0 end do end subroutine foo
Report from: Vector & Auto-parallelization optimizations [vec, par]
LOOP BEGIN f15521.f90(16,3)
remark #15532: loop was not vectorized: compile time constraints prevent loop optimization. Consider using -O3.
LOOP END
Resolution:
Setting check:nobounds will vectorize the loop. Resulting optimization report will include the following remarks:
remark #25084: Preprocess Loopnests: Moving Out Store
remark #15399: vectorization support: unroll factor set to 2
remark #15300: LOOP WAS VECTORIZED
See also:
Requirements for Vectorizable Loops
Vectorization and Optimization Reports
Back to the list of vectorization diagnostics for Intel Fortran