1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-additional-options "--param vect-max-version-for-alias-checks=0 -fopenmp-simd" } */
5 /* Intended to be larger than any VF. */
9 struct s
{ int x
[N
+ 1]; };
10 struct t
{ struct s x
[N
+ 1]; };
11 struct u
{ int x
[N
+ 1]; int y
; };
12 struct v
{ struct s s
; };
15 f1 (struct s
*a
, struct s
*b
)
17 for (int i
= 0; i
< N
; ++i
)
22 f2 (struct s
*a
, struct s
*b
)
24 for (int i
= 0; i
< N
; ++i
)
25 a
[1].x
[i
] += b
[2].x
[i
];
29 f3 (struct s
*a
, struct s
*b
)
31 for (int i
= 0; i
< N
; ++i
)
32 a
[1].x
[i
] += b
[i
].x
[i
];
36 f4 (struct s
*a
, struct s
*b
)
38 for (int i
= 0; i
< N
; ++i
)
39 a
[i
].x
[i
] += b
[i
].x
[i
];
43 f5 (struct s
*a
, struct s
*b
)
45 for (int i
= 0; i
< N
; ++i
)
46 a
->x
[i
] += b
->x
[i
+ 1];
50 f6 (struct s
*a
, struct s
*b
)
52 for (int i
= 0; i
< N
; ++i
)
53 a
[1].x
[i
] += b
[2].x
[i
+ 1];
57 f7 (struct s
*a
, struct s
*b
)
59 for (int i
= 0; i
< N
; ++i
)
60 a
[1].x
[i
] += b
[i
].x
[i
+ 1];
64 f8 (struct s
*a
, struct s
*b
)
66 for (int i
= 0; i
< N
; ++i
)
67 a
[i
].x
[i
] += b
[i
].x
[i
+ 1];
71 f9 (struct s
*a
, struct t
*b
)
73 for (int i
= 0; i
< N
; ++i
)
74 a
->x
[i
] += b
->x
[1].x
[i
];
78 f10 (struct s
*a
, struct t
*b
)
80 for (int i
= 0; i
< N
; ++i
)
81 a
->x
[i
] += b
->x
[i
].x
[i
];
85 f11 (struct u
*a
, struct u
*b
)
87 for (int i
= 0; i
< N
; ++i
)
88 a
->x
[i
] += b
->x
[i
] + b
[i
].y
;
92 f12 (struct s
*a
, struct s
*b
)
94 for (int i
= 0; i
< GAP
; ++i
)
95 a
->x
[i
+ GAP
] += b
->x
[i
];
99 f13 (struct s
*a
, struct s
*b
)
101 for (int i
= 0; i
< GAP
* 2; ++i
)
102 a
->x
[i
+ GAP
] += b
->x
[i
];
106 f14 (struct v
*a
, struct s
*b
)
108 for (int i
= 0; i
< N
; ++i
)
113 f15 (struct s
*a
, struct s
*b
)
115 #pragma omp simd safelen(N)
116 for (int i
= 0; i
< N
; ++i
)
117 a
->x
[i
+ 1] += b
->x
[i
];
120 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 15 "vect" } } */