User and Reference Guide for the Intel® C++ Compiler 14.0

vec-report, Qvec-report

Controls the diagnostic information reported by the vectorizer.

Syntax

Linux OS and OS X:

-vec-report[=n]

Windows OS:

/Qvec-report[:n]

Arguments

n

Is a value denoting which diagnostic messages to report. Possible values are:

0

Tells the vectorizer to report no diagnostic information.

1

Tells the vectorizer to report on vectorized loops.

2

Tells the vectorizer to report on vectorized and non-vectorized loops.

3

Tells the vectorizer to report on vectorized and non-vectorized loops and any proven or assumed data dependences.

4

Tells the vectorizer to report on non-vectorized loops.

5

Tells the vectorizer to report on non-vectorized loops and the reason why they were not vectorized.

6

Tells the vectorizer to use greater detail when reporting on vectorized and non-vectorized loops and any proven or assumed data dependences.

7

Tells the vectorizer to emit vector code quality message ids and corresponding data values for vectorized loops. It provides information such as the expected speedup, memory access patterns, and the number of vector idioms for vectorized loops.

Default

-vec-report=0
or /Qvec-report:0

If you do not specify the option on the command line, the default is to display no messages. However, if vectorization diagnostics reporting has been enabled and you do not specify n, the compiler reports diagnostics on vectorized loops.

Description

This option controls the diagnostic information reported by the vectorizer. The vectorizer report is sent to stdout.

If you do not specify n, it is the same as specifying value 1 for option [Q]vec-report.

For details on each vectorization diagnostic, see the article titled: Vectorization Diagnostics for Intel® C++ Compiler, located at: http://intel.ly/1c3nVmJ. This article includes the root cause of each diagnostic, a code sample that generates the diagnostic, and a possible resolution, if any.

IDE Equivalent

Windows: Diagnostics > Vectorizer Diagnostic Level

Linux: Compilation Diagnostics > Vectorizer Report

OS X: Diagnostics > Vectorizer Diagnostic Report

Alternate Options

None

Example

The following example illustrates the effect of some of the settings when -vec-report is specified on Linux* systems. Note that the remarks you see may differ depending on your coprocessor.

void foo0(int n, int *a)
{
    for (int i = 0; i < n; ++i) {
        if (n & 1) {
            a[i] = a[i+1];
        }
    }
}

void foo1(int n, int *a)
{
   // will not be vectorized due to data dependency.
    for (int i = 1; i < n; ++i) {
        if (n & 1) {
            a[i] = a[i-1];
        }
    }
}
zsh/4 68 % icpc -c -simd -vec_report1 example.cpp
example.cpp(3): (col. 5) remark: LOOP WAS VECTORIZED

zsh/4 69 % icpc -c -simd -vec_report2 example.cpp
example.cpp(3): (col. 5) remark: LOOP WAS VECTORIZED
example.cpp(3): (col. 5) remark: loop was not vectorized: cannot vectorize empty loop
example.cpp(12): (col. 5) remark: loop was not vectorized: existence of vector dependence
example.cpp(12): (col. 5) remark: loop was not vectorized: cannot vectorize empty loop

zsh/4 70 % icpc -c -simd -vec_report3 example.cpp
example.cpp(3): (col. 5) remark: LOOP WAS VECTORIZED
example.cpp(3): (col. 5) remark: REMAINDER LOOP WAS VECTORIZED
example.cpp(3): (col. 5) remark: loop was not vectorized: cannot vectorize empty loop
example.cpp(12): (col. 5) remark: loop was not vectorized: existence of vector dependence
example.cpp(14): (col. 13) remark: vector dependence: assumed FLOW dependence between a line 14 and a line 14
example.cpp(12): (col. 5) remark: loop was not vectorized: cannot vectorize empty loop

zsh/4 73 % icpc -c -simd -vec_report6 example.cpp
example.cpp(3): (col. 5) remark: vectorization support: unroll factor set to 4
example.cpp(3): (col. 5) remark: LOOP WAS VECTORIZED
example.cpp(3): (col. 5) remark: REMAINDER LOOP WAS VECTORIZED
example.cpp(3): (col. 5) remark: loop was not vectorized: cannot vectorize empty loop
example.cpp(12): (col. 5) remark: loop was not vectorized: existence of vector dependence
example.cpp(14): (col. 13) remark: vector dependence: assumed FLOW dependence between a line 14 and a line 14
example.cpp(12): (col. 5) remark: loop was not vectorized: cannot vectorize empty loop

Consider the following command is specified on Linux* OS:

icc -c -vec-report7 satSub.c 2>&1 | vecanalysis.py --list

and the following program is run:

#define SAT_U8(x) ((x) < 0 ? 0 : (x))
void satsub(
  unsigned char *a,
  unsigned char *b,
  int n
){
  int i;
#pragma simd
  for (i=0; i<n; i++){
    a[i] = SAT_U8(a[i] - b[i]);
  }
}

The above program causes the compiler to generate message IDs as output. Then the vecanalysis.py script takes these message IDs as input and produces a .txt file that includes the original source code with line numbers and embedded vec-report=7 messages. This information helps you understand the generated vector code quality without going through ASM code.

The .txt file created has a name similar to the program name. For example, if your program is named satSub.c, the text file is named satSub_c_vr.txt. After the script runs, you will see a message showing the name of the .txt file. For example, "Writing satSub_c_vr.txt ... done".

Note

For the location of the vecanalysis.py script, see the article titled: VecAnalysis Python* Script for Annotating Intel C++ & Fortran Compilers Vectorization Reports, which is located in http://intel.ly/XeSkW6


Submit feedback on this help topic