Diagnostic 15522: Loop Was Not Vectorized: Loop Control Flow Is Too Complex.

ID 732964
Updated 10/29/2014
Version Latest
Public

author-image

By

Product Version: Intel® Fortran Compiler 15.0 and above 

Cause:

The vectorization report generated when using Intel® Fortran Compiler's optimization options (/O3 /Qopt-report:2 /Qopt-report-phase:vec) states that loop was not vectorized since loop control flow is too complex.

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,n)
       integer :: bar
       integer :: i
       integer :: j
       
200   CONTINUE
       i=0
100   CONTINUE
       
       a(i,j)= 0
       i=i+1
       if (i .lt. bar()) goto 100
       j=j+1
       goto 200
     	
end subroutine foo 

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

Report from: Vector optimizations [vec]

  LOOP BEGIN at f1552.f90(10,8)

     remark #15522: loop was not vectorized: loop control flow is too complex.  remark #15522: loop was not vectorized: loop control flow is too complex. Try using canonical loop form..
 
  LOOP END

Resolution:

 -goto statements prevent vectorization, rewriting the code using canonical loops such as 'do - end do' loops will get this loop vectorized.

See also:

Requirements for Vectorizable Loops

Vectorization Essentials

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel® Fortran