1 /* { dg-do compile } */
2 /* { dg-additional-options "-fno-tree-loop-vectorize" } */
3 /* { dg-require-effective-target vect_double } */
4 /* { dg-require-effective-target lp64 } */
7 f1 (double *p
, double *q
, unsigned int n
)
9 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
10 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
11 for (unsigned int i
= 0; i
< n
; i
+= 4)
13 double a
= q
[i
] + p
[i
];
14 double b
= q
[i
+ 1] + p
[i
+ 1];
21 f2 (double *p
, double *q
, unsigned int n
)
23 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
24 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
25 for (unsigned int i
= 0; i
< n
; i
+= 2)
27 double a
= q
[i
] + p
[i
];
28 double b
= q
[i
+ 1] + p
[i
+ 1];
35 f3 (double *p
, double *q
, unsigned int n
)
37 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
38 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
39 for (unsigned int i
= 0; i
< n
; i
+= 6)
41 double a
= q
[i
] + p
[i
];
42 double b
= q
[i
+ 1] + p
[i
+ 1];
49 f4 (double *p
, double *q
, unsigned int start
, unsigned int n
)
51 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
52 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
53 for (unsigned int i
= start
& -2; i
< n
; i
+= 2)
55 double a
= q
[i
] + p
[i
];
56 double b
= q
[i
+ 1] + p
[i
+ 1];
62 /* { dg-final { scan-tree-dump-times "optimized: basic block" 4 "slp1" } } */