Diagnostic 15398: Loop Was Not Vectorized: Loop Was Transformed To Memset Or Memcpy

ID 732960
Updated 6/29/2015
Version Latest
Public

author-image

By

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

Cause:

When code contains a loop or array syntax performing a simple initialization or a copy, the compiler may replace the loop with a function call to either set memory (memset) or copy memory (memcpy). The vectorization report generated using Intel® Fortran Compiler's optimization and vectorization report options includes non-vectorized loop instance:

Windows* OS:  /O2  /Qopt-report:2  /Qopt-report-phase:vec    

Linux OS or OS X:  -O2 -qopt-report2  -qopt-report-phase=vec 

Example:

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

program f15398
implicit none
integer, parameter :: N=32
integer :: i,a(N)
  !...initialize array using DO
  do i=1,N
    a(i) = 0
  end do
  a = 0   !...same, with array syntax 
  print*, a(1)

end program f15398

ifort -c /O2 /Qopt-report:2 /Qopt-report-phase:vec /Qopt-report-file:stdout f15398.f90
 
Begin optimization report for: F15398

    Report from: Vector optimizations [vec]
    
LOOP BEGIN at f15398.f90(6,3)
   remark #15398: loop was not vectorized: loop was transformed to memset or memcpy
LOOP END

LOOP BEGIN at f15398.f90(9,3)
   remark #15398: loop was not vectorized: loop was transformed to memset or memcpy
LOOP END

See also:

Requirements for Vectorizable Loops

Vectorization Essentials

Vectorization and Optimization Reports

Back to the list of vectorization diagnostics for Intel® Fortran