Generating a Vectorization Report

A vectorization report shows what loops in your code were vectorized and explains why other loops were not vectorized. To generate a vectorization report, use the /Qvec-report1 or the /Qvec-report2 compiler options. These options generate reports that show the loops in your code that were vectorized and the reason why other loops were not vectorized.

The /Qvec-report1 option generates a report with the loops in your code that were vectorized while the /Qvec-report2 option generates a report with both the loops in your code that were vectorized and the reason why other loops were not vectorized.

To use the /Qvec-report1 option, select Project > Properties > Fortran > Diagnostics > Vectorizer Diagnostic Level > Loops Successfully Vectorized(1)(/Qvec-report1).

Because vectorization is off with the Minimize Size (/O1) option, the compiler does not generate a vectorization report. To generate a vectorization report, build your project with the Maximize Speed option:

To set the Maximize Speed option, select Project > Properties > Fortran > Optimization > Optimization > Maximize Speed.

Rebuild your project and then run the executable (Debug > Start Without Debugging). Record the new execution time. The reduction in time is mostly due to auto-vectorization of the inner loop at line 32 noted in the vectorization report:

matvec.f90(32) (col. 3): remark: LOOP WAS VECTORIZED.
matvec.f90(38) (col. 6): remark: LOOP WAS VECTORIZED.
driver.f90(59) (col. 5): remark: LOOP WAS VECTORIZED.
driver.f90(61) (col. 5): remark: LOOP WAS VECTORIZED.
driver.f90(80) (col. 29): remark: LOOP WAS VECTORIZED.

Note

Your line and column numbers may be different.

The /Qvec-report2 option returns a list that also includes loops that were not vectorized, along with the reason why the compiler did not vectorize them. Add the /Qvec-report2 option by selecting Project > Properties > Fortran > Diagnostics > Vectorizer Diagnostic Level > Loops Successfully and Unsuccessfully Vectorized (2)(/Qvec-report2)

Rebuild your project with the /Qvec-report2 option.

The vectorization report indicates that the loop at line 33 in matvec.f90 did not vectorize because it is not the innermost loop of the loop nest..

matvec.f90(32) (col. 3): remark: LOOP WAS VECTORIZED.
matvec.f90(33) (col. 3): remark: loop was not vectorized: not inner loop.
matvec.f90(38) (col. 6): remark: LOOP WAS VECTORIZED.
driver.f90(59) (col. 5): remark: loop was not vectorized: not inner loop.
driver.f90(59) (col. 5): remark: loop was not vectorized: vectorization possible but seems inefficient.
driver.f90(59) (col. 5): remark: loop was not vectorized: not inner loop.
driver.f90(59) (col. 5): remark: loop was not vectorized: subscript too complex.
driver.f90(59) (col. 5): remark: loop was not vectorized: not inner loop.
driver.f90(59) (col. 5): remark: LOOP WAS VECTORIZED.
driver.f90(61) (col. 5): remark: loop was not vectorized: vectorization possible but seems inefficient.
driver.f90(61) (col. 5): remark: LOOP WAS VECTORIZED.
driver.f90(80) (col. 29): remark: LOOP WAS VECTORIZED.
driver.f90(74) (col. 7): remark: loop was not vectorized: nonstandard loop is not a vectorization candidate.

Note

Next: Improving Performance by Aligning Data


Submit feedback on this help topic