annotate gcc/testsuite/gcc.dg/vect/vect-live-slp-3.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-require-effective-target vect_long } */
kono
parents:
diff changeset
2 /* { dg-additional-options "-fno-tree-scev-cprop" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 #include "tree-vect.h"
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 /* Statement in SLP vectorization used outside the loop.
kono
parents:
diff changeset
7 NOTE: SCEV disabled to ensure the live operation is not removed before
kono
parents:
diff changeset
8 vectorization. */
kono
parents:
diff changeset
9 #define LIVELOOP(RET) \
kono
parents:
diff changeset
10 __attribute__ ((noinline)) long \
kono
parents:
diff changeset
11 liveloop##RET (int n, long *x, long *y) \
kono
parents:
diff changeset
12 { \
kono
parents:
diff changeset
13 long n0, n1, n2, n3; \
kono
parents:
diff changeset
14 int j; \
kono
parents:
diff changeset
15 for (j = 0; j < n; ++j) \
kono
parents:
diff changeset
16 { \
kono
parents:
diff changeset
17 n0 = x[(j*4)]; \
kono
parents:
diff changeset
18 n1 = x[(j*4)+1]; \
kono
parents:
diff changeset
19 n2 = x[(j*4)+2]; \
kono
parents:
diff changeset
20 n3 = x[(j*4)+3]; \
kono
parents:
diff changeset
21 y[(j*4)] = n0 + 1; \
kono
parents:
diff changeset
22 y[(j*4)+1] = n1 + 2; \
kono
parents:
diff changeset
23 y[(j*4)+2] = n2 + 3; \
kono
parents:
diff changeset
24 y[(j*4)+3] = n3 + 4; \
kono
parents:
diff changeset
25 } \
kono
parents:
diff changeset
26 return n##RET; \
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 LIVELOOP (0)
kono
parents:
diff changeset
30 LIVELOOP (1)
kono
parents:
diff changeset
31 LIVELOOP (2)
kono
parents:
diff changeset
32 LIVELOOP (3)
kono
parents:
diff changeset
33 typedef long (*FP)(int n, long *x, long *y);
kono
parents:
diff changeset
34 const FP llf[]= {&liveloop0, &liveloop1, &liveloop2, &liveloop3};
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 #define MAX 153
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 int
kono
parents:
diff changeset
39 main (void)
kono
parents:
diff changeset
40 {
kono
parents:
diff changeset
41 long a[MAX*4];
kono
parents:
diff changeset
42 long b[MAX*4];
kono
parents:
diff changeset
43 int i;
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 check_vect ();
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 for (i=0; i<MAX*4; i++)
kono
parents:
diff changeset
48 {
kono
parents:
diff changeset
49 __asm__ volatile ("");
kono
parents:
diff changeset
50 a[i] = i;
kono
parents:
diff changeset
51 }
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 for (i=0; i<4; i++)
kono
parents:
diff changeset
54 {
kono
parents:
diff changeset
55 __asm__ volatile ("");
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 int ret = llf[i] (MAX, a, b);
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 if (ret != (MAX * 4) - 4 + i)
kono
parents:
diff changeset
60 abort ();
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 for (i=0; i<MAX*4; i++)
kono
parents:
diff changeset
63 {
kono
parents:
diff changeset
64 __asm__ volatile ("");
kono
parents:
diff changeset
65 if (b[i] != i + (i%4) + 1)
kono
parents:
diff changeset
66 abort ();
kono
parents:
diff changeset
67 }
kono
parents:
diff changeset
68 }
kono
parents:
diff changeset
69 }
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 4 "vect" } } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
72 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { xfail vect_variable_length } } } */
111
kono
parents:
diff changeset
73 /* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant" 4 "vect" } } */