1 /* PR tree-optimization/88464 */
2 /* { dg-do compile } */
3 /* { dg-options "-O3 -mavx512f -mprefer-vector-width=512 -mtune=skylake-avx512 -fdump-tree-vect-details" } */
4 /* { dg-final { scan-tree-dump-times "loop vectorized using 64 byte vectors" 4 "vect" } } */
5 /* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 4 "vect" } } */
6 
7 __attribute__((noipa)) void
f1(double * __restrict__ a,const double * __restrict__ b,const int * __restrict__ c,int n)8 f1 (double * __restrict__ a, const double * __restrict__ b, const int * __restrict__ c, int n)
9 {
10   int i;
11 #pragma GCC ivdep
12   for (i = 0; i < n; ++i)
13     if (b[i] > -2.0)
14       a[c[i]] = b[i];
15 }
16 
17 __attribute__((noipa)) void
f2(double * __restrict__ a,const double * __restrict__ b,const long * __restrict__ c,int n)18 f2 (double * __restrict__ a, const double * __restrict__ b, const long * __restrict__ c, int n)
19 {
20   int i;
21 #pragma GCC ivdep
22   for (i = 0; i < n; ++i)
23     if (b[i] > -2.0)
24       a[c[i]] = b[i];
25 }
26 
27 __attribute__((noipa)) void
f3(float * __restrict__ a,const float * __restrict__ b,const int * __restrict__ c,int n)28 f3 (float * __restrict__ a, const float * __restrict__ b, const int * __restrict__ c, int n)
29 {
30   int i;
31 #pragma GCC ivdep
32   for (i = 0; i < n; ++i)
33     if (b[i] > -2.0f)
34       a[c[i]] = b[i];
35 }
36 
37 __attribute__((noipa)) void
f4(float * __restrict__ a,const float * __restrict__ b,const long * __restrict__ c,int n)38 f4 (float * __restrict__ a, const float * __restrict__ b, const long * __restrict__ c, int n)
39 {
40   int i;
41 #pragma GCC ivdep
42   for (i = 0; i < n; ++i)
43     if (b[i] > -2.0f)
44       a[c[i]] = b[i];
45 }
46