1 /* { dg-do compile } */
2 /* { dg-additional-options "-fno-tree-loop-vectorize -fno-tree-dominator-opts" } */
3 /* { dg-require-effective-target lp64 } */
5 /* A ranger based DOM causes many more SSA names to be exported, which
6 causes slp1 to vectorize more things. Disabling DOM to avoid
7 disturbing this test. */
10 f1 (double *p
, double *q
, unsigned int n
)
12 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
13 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
14 for (unsigned int i
= 0; i
< n
; i
+= 1)
16 double a
= q
[i
] + p
[i
];
17 double b
= q
[i
+ 1] + p
[i
+ 1];
24 f2 (double *p
, double *q
, unsigned int n
)
26 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
27 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
28 for (unsigned int i
= 0; i
< n
; i
+= 3)
30 double a
= q
[i
] + p
[i
];
31 double b
= q
[i
+ 1] + p
[i
+ 1];
38 f3 (double *p
, double *q
, unsigned int start
, unsigned int n
)
40 p
= (double *) __builtin_assume_aligned (p
, sizeof (double) * 2);
41 q
= (double *) __builtin_assume_aligned (q
, sizeof (double) * 2);
42 for (unsigned int i
= start
; i
< n
; i
+= 2)
44 double a
= q
[i
] + p
[i
];
45 double b
= q
[i
+ 1] + p
[i
+ 1];
51 /* { dg-final { scan-tree-dump-not "optimized: basic block" "slp1" } } */