Diagnostic 15521: loop was not vectorized: explicitly compute the iteration count before executing the loop.

Product Version: Intel® Fortran Compiler 15.0 and above

Cause:

When using Intel® Fortran Compiler's optimization options:

/O3 /Qopt-report:2 /Qopt-report-phase:vec

The vectorization report generated by the compiler states that the loop was not vectorized since the loop count could not be computed before executing the loop.

Example:

An example below will generate the following remark in optimization report:

integer function  foo
implicit none 
   
  foo = 1
  do while (foo < 10000)  
     foo = foo + foo**2
  end do 
  
end  function foo

ifort -c /O3 /Qopt-report:2 /Qopt-report-phase:vec /Qopt-report-file:stdout f15521.f90

Begin optimization report for: FOO

    Report from: Vector optimizations [vec]

LOOP BEGIN at f15521.f90(5,3)
   remark #15521: loop was not vectorized: explicitly compute the iteration count before executing the loop or try using canonical loop form
LOOP END

 

See also:

Requirements for Vectorizable Loops

Vectorization Essentials

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel® Fortran

 

有关编译器优化的更完整信息,请参阅优化通知