Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

Diagnostic 15534: Loop was not vectorized: loop contains arithmetic if or computed goto.

$
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 ( -O3 or -O2  -Qopt-report:2 ) states that loop was not vectorized since loop contains GOTO statement.

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)
      integer, intent(inout) :: b(n)
      integer:: i

      do i=1,n
             goto (100,200,300,400,100,200,300,400) b(i)
100    a(i) = a(i) + 1
         if (a(i) .gt. 0) goto 400
200    a(i) = a(i) + 1
400     continue
300    a(i) = a(i) + 1
      end do

end subroutine foo

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

Non-optimizable loops:

LOOP BEGIN at f15534.f90(15,7)
   remark #15534: loop was not vectorized: loop contains arithmetic if or computed goto. Consider using if-then-else statement.     
LOOP END

Resolution:

Premature exits from loops prevent vectorization, rewriting the code without 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
  • Développeurs
  • Partenaires
  • Professeurs
  • Étudiants
  • Apple OS X*
  • Linux*
  • Microsoft Windows* (XP, Vista, 7)
  • Microsoft Windows* 8
  • Yocto Project
  • Internet des objets
  • Windows*
  • Fortran
  • Avancé
  • Intermédiaire
  • Intel® Composer XE
  • Intel® Fortran Composer XE
  • Intel® Visual Fortran Composer XE
  • Intel® Cluster Studio XE
  • Intel® Fortran Studio XE
  • Intel® Parallel Studio XE
  • Intel® Parallel Studio XE Cluster Edition
  • Intel® Parallel Studio XE Composer Edition
  • Intel® Parallel Studio XE Professional Edition
  • Intel® Advanced Vector Extensions
  • Outils de développement
  • Optimisation
  • Vectorisation
  • Intégré
  • PC portable
  • Serveur
  • Bureau
  • URL
  • Rubriques de compilateurs
  • Recherche d’erreurs
  • Amélioration des performances
  • Zone des thèmes: 

    IDZone
  • Windows*

  • Viewing all articles
    Browse latest Browse all 3108


    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>