1 /* { dg-require-effective-target vect_int } */
7 #define N (VECTOR_BITS * 4 / 16)
12 unsigned short in
[N
] = {};
13 unsigned short in2
[N
] = {};
14 unsigned short in3
[N
] = {};
21 for (i
= 0; i
< N
; i
++)
23 in
[i
] = in2
[i
] = in3
[i
] = i
;
24 asm volatile ("" ::: "memory");
27 for (i
= 0; i
< N
/4; i
++)
29 in
[i
*4] = in
[i
*4] + 5;
30 in
[i
*4 + 1] = in
[i
*4 + 1] + 5;
31 in
[i
*4 + 2] = in
[i
*4 + 2] + 5;
32 in
[i
*4 + 3] = in
[i
*4 + 3] + 5;
37 for (i
= 0; i
< N
; i
++)
43 /* Not vectorizable because of data dependencies. */
44 for (i
= 1; i
< N
/4; i
++)
46 in2
[i
*4] = in2
[(i
-1)*4] + 5;
47 in2
[i
*4 + 1] = in2
[(i
-1)*4 + 1] + 5;
48 in2
[i
*4 + 2] = in2
[(i
-1)*4 + 2] + 5;
49 in2
[i
*4 + 3] = in2
[(i
-1)*4 + 3] + 5;
54 for (i
= 0; i
< N
; i
++)
56 if (in2
[i
] != (i
% 4) + (i
/ 4) * 5)
60 /* Not vectorizable because of data dependencies: distance 3 is greater than
61 the actual VF with SLP (2), but the analysis fail to detect that for now. */
62 for (i
= 3; i
< N
/4; i
++)
64 in3
[i
*4] = in3
[(i
-3)*4] + 5;
65 in3
[i
*4 + 1] = in3
[(i
-3)*4 + 1] + 5;
66 in3
[i
*4 + 2] = in3
[(i
-3)*4 + 2] + 5;
67 in3
[i
*4 + 3] = in3
[(i
-3)*4 + 3] + 5;
72 for (i
= 0; i
< N
; i
++)
74 if (in3
[i
] != (i
% 12) + (i
/ 12) * 5)
91 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
92 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */