Developer Guide and Reference

Contents

ivdep

Instructs the compiler to ignore assumed vector dependencies.

Syntax

#pragma ivdep
Arguments
None
Description
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.
In addition to the
ivdep
pragma, the
vector
pragma can be used to override the efficiency heuristics of the vectorizer.
The proven dependencies that prevent vectorization are not ignored, only assumed dependencies are ignored.

Examples

Example
void ignore_vec_dep(int *a, int k, int c, int m) {   #pragma ivdep   for (int i = 0; i < m; i++)     a[i] = a[i + k] * c; }
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
.
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.
Example
#pragma ivdep for (i=1; i<n; i++) {    e[ix[2][i]] = e[ix[2][i]]+1.0;   e[ix[3][i]] = e[ix[3][i]]+2.0; }
This loop requires the parallel option in addition to the
ivdep
pragma to indicate there is no loop-carried dependencies:
Example
#pragma ivdep for (j=0; j<n; j++) { a[b[j]] = a[b[j]] + 1; }
This loop requires the parallel option in addition to the
ivdep
pragma to ensure there is no loop-carried dependency for the store into
a()
.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804