The Dependencies analysis shows there is a real (proven) dependency in the loop. To fix: Do one of the following:
- If there is an anti-dependency, enable vectorization using the directive #pragma omp simd safelen(length) , where length is smaller than the distance between dependent iterations in anti-dependency.
#pragma omp simd safelen(4) ...#pragma omp simd safelen(4) for (i = 0; i < n - 4; i += 4) { a[i + 4] = a[i] * c; } - If there is a reduction pattern dependency in the loop, enable vectorization using the directive #pragma omp simd reduction(operator:list).
#pragma omp simd reduction(+:sumx) ...#pragma omp simd reduction(+:sumx) for (k = 0;k < size2; k++) { sumx += x[k]*b[k]; } - Rewrite the code to remove the dependency. Use programming techniques such as variable privatization.