Intel® Advisor Help
The compiler assumed there is an anti-dependency (Write after read - WAR) or a true dependency (Read after write - RAW) in the loop. Improve performance by investigating the assumption and handling accordingly.
There is no confirmation that a real (proven) dependency is present in the loop. To confirm: Run a Dependencies analysis.
The Dependencies analysis shows there is a real (proven) dependency in the loop. To fix: Do one of the following:
#pragma omp simd safelen(4)
for (i = 0; i < n - 4; i += 4)
{
a[i + 4] = a[i] * c;
}
#pragma omp simd reduction(+:sumx)
for (k = 0;k < size2; k++)
{
sumx += x[k]*b[k];
}
Read More:
The Dependencies analysis shows there is no real dependency in the loop for the given workload. Tell the compiler it is safe to vectorize using the restrict keyword or a directive:
| Directive | Outcome |
|---|---|
| #pragma simd or #pragma omp simd | Ignores all dependencies in the loop |
| #pragma ivdep | Ignores only vector dependencies (which is safest) |
Example:
#pragma ivdep
for (i = 0; i < n - 4; i += 4)
{
a[i + 4] = a[i] * c;
}
Read More: