1 /* { dg-do compile } */
2 /* { dg-additional-options "-fno-tree-loop-vectorize -fno-tree-dominator-opts" } */
3 /* { dg-require-effective-target lp64 } */
9 f1 (double *p
, double *q
)
11 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
12 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
13 for (unsigned int i
= 2; i
< ~0U - 4; i
+= 4)
15 double a
= q
[i
+ 2] + p
[i
+ 2];
16 double b
= q
[i
+ 3] + p
[i
+ 3];
23 f2 (double *p
, double *q
)
25 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
26 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
27 for (unsigned int i
= 0; i
< ~0U - 3; i
+= 4)
29 double a
= q
[i
+ 4] + p
[i
+ 4];
30 double b
= q
[i
+ 5] + p
[i
+ 5];
37 f3 (double *p
, double *q
)
39 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
40 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
41 for (unsigned int i
= 0; i
< 1000; i
+= 4)
43 double a
= q
[i
- 2] + p
[i
- 2];
44 double b
= q
[i
- 1] + p
[i
- 1];
51 f4 (double *p
, double *q
)
53 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
54 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
55 for (unsigned int i
= 2; i
< 1000; i
+= 4)
57 double a
= q
[i
- 4] + p
[i
- 4];
58 double b
= q
[i
- 3] + p
[i
- 3];
64 /* { dg-final { scan-tree-dump-not "optimized: basic block" "slp1" } } */