libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / bb-slp-pr81635-3.c
blob793f1859907bbe8e128a3689a3f1b08b2a0cf68d
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 } */
6 void
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];
15 q[i] = a;
16 q[i + 1] = b;
20 void
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];
29 q[i] = a;
30 q[i + 1] = b;
34 void
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];
43 q[i] = a;
44 q[i + 1] = b;
48 void
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];
57 q[i] = a;
58 q[i + 1] = b;
62 /* { dg-final { scan-tree-dump-times "optimized: basic block" 4 "slp1" } } */