Diagnostic 15537: Loop was not vectorized: implied FP exception model prevents usage of SVML library.

By Devorah Hayman, Published: 10/29/2014, Last Updated: 09/24/2015

Product Version: Intel® Visual Fortran Compiler XE 15.0 or a later version

Cause:

The vectorization report generated when using Visual Fortran Compiler's  flags and optimization options (/O2 /fpe:0 /Qopt-report:2states that loop was not vectorized due to Floating-Point exception handling .

Example:

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

subroutine foo (a, l, n)
       implicit none
       integer, intent(in) :: n
       double precision, intent(inout) :: a(n)
       integer :: l(n)
       integer :: i
       
       do i=1,n
           l(i) = mod(a(i), 1.0)
       end do
end subroutine foo

ifort -c /O2 /fpe:0 /Qopt-report:2 /Qopt-report-phase:vec /Qopt-report-file:stdout f15537.f90

(ifort -c -O2 -fpe=0 -qopt-report2  f15537.f90 for Linux)

 
Begin optimization report for: FOO

    Report from: Vector optimizations [vec]

LOOP BEGIN at f15537.f90(8,8)
   remark #15537: loop was not vectorized: implied FP exception model prevents usage of SVML library needed for truncation or integer divide/remainder. Consider changing compiler flags and/or directives in the source to enable fast FP model and to mask FP exceptions   [ f15537.f90(9,19) ]
LOOP END

Resolution:

Masking FP exceptions /fpe:1 and setting a threshold for the vectorization of loops to 0  /Qvec-threshold:0 will get the loop vectorized:

ifort -c /O2 /fpe:1 /Qvec-threshold:0 /Qopt-report:2 /Qopt-report-phase:vec /Qopt-report-file:stdout f15537.f90

(ifort -c -O2 -fpe=1 -vec-threshold=0  -qopt-report2  f15537.f90 for Linux)

LOOP BEGIN  f15537.f90(8,8)

    remark #15300: LOOP WAS VECTORIZED
LOOP END

See also:

Requirements for Vectorizable Loops

Vectorization Essentials

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel® Fortran

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804