Developer Guide and Reference

Contents

GAP Message (Diagnostic ID 30513)

Message

Insert a "%s ivdep" statement right before the loop at line %d to vectorize the loop.

Advice

Add
"#pragma ivdep"
before the specified loop. This
pragma
enables the vectorization of the loop at the specified line by ignoring some of the assumed cross-iteration data dependencies.
Example
Consider the following:
void foo(float *a, int x, int n) { int i; for (i=0; i<n; i++) { a[i] = a[i+x]+1; } return; }
In this case, the compiler is unable to vectorize the loop because
x
could be -1, where each iteration is dependent on the previous iteration. If
x
is known to be positive, you can vectorize this loop.
If you determine it is safe to do so, you can add the
pragma
as follows:
void foo(float *a, int x, int n) { int i; #pragma ivdep for (i=0; i<n; i++) { a[i] = a[i+x]+1; } return; }

Verify

Confirm that any arrays in the loop do not have unsafe cross-iteration dependencies. A cross-iteration dependency exists if a memory location is modified in an iteration of the loop and accessed by a
read or a write statement
in another iteration of the loop. Make sure that there are no such dependencies, or that any cross-iteration dependencies can be safely ignored.

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