Diagnostic 15423: loop has only one iteration

Product Version: Intel® Fortran Compiler 15.0 and a later version 

Cause:

The Intel® Fortran Compiler will not vectorize a loop when it knows the loop has only one iteration. If the user requires vectorization by using a SIMD directive, the compiler emits a warning diagnostic.

Example:

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

subroutine f15423( a, b, n )  
  implicit none
  real, dimension(*) :: a, b
  integer            :: i, n
 
  n=1

!$omp simd
  do i=1,n  
     b(i) = 1. - a(i)**2
  end do 
  
end subroutine f15423

$ ifort -c -qopenmp-simd f15423.f90

f15423.f90(8): (col. 7) remark: simd loop has only one iteration

f15423.f90(8): (col. 7) warning #13379:  was not vectorized with "simd"

Resolution: 

If the loop really has only one iteration, don’t use a SIMD directive or don’t code a loop.

If the statement  n=1  was inserted unintentionally, remove it and the loop will vectorize

See also:

Requirements for Vectorizable Loops

Vectorization Essentials

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel® Fortran

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