Product Version: Intel® Visual Fortran Compiler XE 15.0 or a later version
Cause:
The vectorization report generated when using Visual Fortran Compiler's optimization options ( /O2 /Qopt-report:2 ) states that compile time constraints prevent optimization.
Example:
An example below will generate the following remark in optimization report:
subroutine foo(a, n)
implicit none
integer, intent(in) :: n
double precision, intent(inout) :: a(n)
integer :: bar
integer :: i
i=0
100 CONTINUE
a(i)=0
i=i+1
if (i .lt. bar()) goto 100
end subroutine foo
Report from: Loop nest, Vector & Auto-parallelization optimizations [loop, vec, par]
LOOP BEGIN
remark #15532: loop was not vectorized: compile time constraints prevent loop optimization. Consider using -O3.
LOOP END
Resolution:
GOTO statements prevent vectorization since loop iteration count cannot be computed.
See also:
Requirements for Vectorizable Loops
Vectorization and Optimization Reports