Tutorial: Using Auto Vectorization with Intel® Fortran Compiler

ID 758497
Date 4/11/2022
Public

Improving Performance with Interprocedural Optimization

The compiler may be able to perform additional optimizations if it is able to optimize across source line boundaries. These may include, but are not limited to, function inlining. This is enabled with the -ipo option.

Recompile the program using the -ipo option to enable interprocedural optimization.

ifort -real-size 64 -qopt-report=2 -qopt-report-phase=vec -D ALIGNED -ipo matvec.f90 driver.f90 -o MatVector

Note that the vectorization messages now appear at the point of inlining in driver.f90 (line 70) and this is found in the file ipo_out.optrpt.

LOOP BEGIN at driver.f90(73,16)
   remark #15541: loop was not vectorized: inner loop was already vectorized

   LOOP BEGIN at matvec.f90(32,3) inlined into driver.f90(70,14)
      remark #15398: loop was not vectorized: loop was transformed to memset or memcpy
   LOOP END

   LOOP BEGIN at matvec.f90(33,3) inlined into driver.f90(70,14)
      remark #15541: loop was not vectorized: inner loop was already vectorized

      LOOP BEGIN at matvec.f90(38,6) inlined into driver.f90(70,14)
         remark #15399: vectorization support: unroll factor set to 4
         remark #15300: LOOP WAS VECTORIZED
      LOOP END
   LOOP END
LOOP END 

NOTE:
Your line and column numbers may be different.

Now, run the executable and record the execution time.

Did you find the information on this page useful?

Characters remaining:

Feedback Message