Debian Codegraph @

gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c

raw
1 /* { dg-require-effective-target vect_condition } */
2 /* { dg-additional-options "-fdump-tree-vect-details" } */
3
4 #include "tree-vect.h"
5
6 #define N 128
7
8 __attribute__((noinline, noclone)) void
9 foo (int *a, int stride)
10 {
11 int i;
12
13 for (i = 0; i < N/stride; i++, a += stride)
14 {
15 a[0] = a[0] ? 1 : 5;
16 a[1] = a[1] ? 2 : 6;
17 a[2] = a[2] ? 3 : 7;
18 a[3] = a[3] ? 4 : 8;
19 }
20 }
21
22
23 int a[N];
24 int main ()
25 {
26 int i;
27
28 check_vect ();
29
30 for (i = 0; i < N; i++)
31 {
32 a[i] = i;
33 asm volatile ("" ::: "memory");
34 }
35
36 foo (a, 4);
37
38 #pragma GCC novector
39 for (i = 1; i < N; i++)
40 if (a[i] != i%4 + 1)
41 abort ();
42
43 if (a[0] != 5)
44 abort ();
45
46 return 0;
47 }
48
49 /* { dg-final { scan-tree-dump {(no need for alias check [^\n]* when VF is 1|no alias between [^\n]* when [^\n]* is outside \(-16, 16\))} "vect" { target vect_element_align } } } */
50 /* { dg-final { scan-tree-dump-times "loop vectorized" 1 "vect" { target { vect_element_align && { ! { amdgcn-*-* } } } } } } */
51 /* { dg-final { scan-tree-dump-times "loop vectorized" 2 "vect" { target { amdgcn-*-* } } } } */
52