1 /* PR tree-optimization/78899 */
2 /* { dg-do compile } */
3 /* { dg-options "-Ofast -fopenmp-simd -mavx2 -mno-avx512f" } */
4
5 #define N 1024
6 #define M 4
7 int p1[N], p2[N], p3[N], c[N];
8
9 void
foo(int n)10 foo (int n)
11 {
12 int i, k;
13 for (k = 0; k < n / M; k++)
14 {
15 #pragma omp simd
16 for (i = 0; i < M; i++)
17 if (c[k * M + i])
18 {
19 p1[k * M + i] += 1;
20 p2[k * M + i] = p3[k * M + i] + 2;
21 }
22 }
23 }
24
25 /* Ensure the loop is vectorized. */
26 /* { dg-final { scan-assembler "vpmaskmov" } } */
27 /* { dg-final { scan-assembler "vpadd" } } */
28