If the following operations(s) can be safely performed unconditionally, the loop at line %d will be vectorized by adding a "%s ivdep" statement right before the loop: %s.
Add "#pragma ivdep" before the specified loop.
This pragma enables the vectorization of the loop at the specified line. You should ensure that any conditional divide, sqrt, and inverse sqrt operations will not alter the exception semantics expected by the program when they are performed unconditionally.
Consider the following:
void foo(float *a, int n) {
int i;
for (i=0; i<n; i++) {
if (a[i] > 0) {
a[i] = 1 / a[i];
}
}
return;
}
In this case, the compiler is unable to vectorize the loop if compiled with floating-point exception semantics (such as /fp:except option) since the condition "a[i] > 0" may be guarding floating-point exceptions for the divide.
If you determine it is safe to do so, you can add the pragma as follows:
void foo(float *a, int n) {
int i;
#pragma ivdep
for (i=0; i<n; i++) {
if (a[i] > 0) {
a[i] = 1 / a[i];
}
}
return;
}
Make sure that the program operands have safe values for all iterations.
Copyright © 1996-2011, Intel Corporation. All rights reserved.