Intel® C++ Compiler XE 13.1 User and Reference Guides
Instructs the compiler to ignore assumed vector dependencies.
The ivdep pragma instructs the compiler to ignore assumed vector dependencies. To ensure correct code, the compiler treats an assumed dependence as a proven dependence, which prevents vectorization. This pragma overrides that decision. Use this pragma only when you know that the assumed loop dependencies are safe to ignore.
The proven dependencies that prevent vectorization are not ignored, only assumed dependencies are ignored.
The loop in this example will not vectorize without the ivdep pragma, since the value of k is not known; vectorization would be illegal if k<0.
void ignore_vec_dep(int *a, int k, int c, int m)
for (int i = 0; i < m; i++)
a[i] = a[i + k] * c;
The pragma binds only the for loop contained in current function. This includes a for loop contained in a sub-function called by the current function.
The following loop requires the parallel option in addition to the ivdep pragma to indicate there is no loop-carried dependencies:
for (i=1; i<n; i++)
e[ix[i]] = e[ix[i]]+1.0;
e[ix[i]] = e[ix[i]]+2.0;
The following loop requires the parallel option in addition to the ivdep pragma to ensure there is no loop-carried dependency for the store into a().
for (j=0; j<n; j++)
a[b[j]] = a[b[j]] + 1;