Diagnostic 15335: Vectorization Possible But Seems Inefficient

ID 736385
Updated 10/3/2014
Version Latest
Public

author-image

By

Product Version:  Intel® Fortran Compiler 15.0 and above 

Cause: 

The vectorization report generated using Visual Fortran Compiler's optimization and vectorization report options  -O2 -Qvec-report2 -Qopt-report:2 states that loop was not vectorized: vectorization possible but seems inefficient.

Example:

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

subroutine foo(a, b, n)
    implicit none
    integer, intent(in) :: n
    real, intent(inout) :: a(n)
    real, intent(out)   :: b
    real :: x = 0
    integer :: i

    do i=1,n
            x = x + a(2*i)
    end do
    
    b = x
    
end subroutine foo

ifort -c /O2 /Qopt-report:2 /Qopt-report-phase:vec /Qopt-report-file:stdout f15335.f90

 Report from: Vector optimizations [vec]

LOOP BEGIN at f15335.f90(9,5)

   remark #15335: loop was not vectorized: vectorization possible but seems inefficient. Use vector always directive or /Qvec-threshold0 to override
LOOP END

Resolution:

Using !DEC$ VECTOR ALWAYS directive in the code will vectorize the loop by overriding efficiency heuristics of the vectorizer.

See also:   
VECTOR and NOVECTOR

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel® Fortran