Quantcast
Channel: 中级
Viewing all articles
Browse latest Browse all 669

Diagnostic 15524: Loop was not vectorized: search loop cannot be vectorized unless all memory references can be aligned vector load.

$
0
0

Product Version: Intel(R) Visual Fortran Compiler XE 15.0.0.070

Cause:

The vectorization report generated when using Visual Fortran Compiler's optimization options ( -O2  -Qopt-report:2 ) states that loop was not vectorized since all memory references cannot be an aligned vector load.

Example:

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

integer function foo(a, n)

       implicit none
       integer, intent(in) :: n
       real, intent(inout) :: a(n)
       integer :: i

       do i=1,n
         if (a(2*i) .eq. 0) goto 100
       end do

100    CONTINUE
       foo = i

end function foo

Report from: Vector & Auto-parallelization optimizations [vec, par]

 LOOP BEGIN at f15524.f90(8,8)

   remark #15524: loop was not vectorized: search loop cannot be vectorized unless all memory references can be aligned vector load. 

LOOP END

Resolution:

 In search loop vectorization if a “vector load” fits entirely within a cache line, and if such a vector load has one non-speculatively accessed  element, it is safe for the compiler to speculatively load all other elements (within the same cache line) in such a vector load. 
Rewriting the code and avoiding GOTO statements 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

  • vectorization
  • Intel Compilers Vectorization Reports Optimization Reports
  • Optimization Reports
  • vec-report vectorization reports
  • diagnostic messages
  • 开发人员
  • 合作伙伴
  • 教授
  • 学生
  • Apple OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8
  • 物联网
  • Windows*
  • Fortran
  • 高级
  • 中级
  • 英特尔® Composer XE
  • 英特尔® Fortran Composer XE
  • 英特尔® Visual Fortran Composer XE
  • Intel® Cluster Studio XE
  • 英特尔® Fortran Studio XE
  • 英特尔® Parallel Studio XE
  • 英特尔® Parallel Studio XE Cluster Edition
  • 英特尔® Parallel Studio XE Composer Edition
  • 英特尔® Parallel Studio XE Professional Edition
  • Intel® Advanced Vector Extensions
  • 开发工具
  • 优化
  • 矢量化
  • 嵌入式
  • 笔记本电脑
  • 服务器
  • 桌面
  • URL
  • 编译器主题
  • 提升性能
  • 主题专区: 

    IDZone
  • Windows*

  • Viewing all articles
    Browse latest Browse all 669

    Trending Articles