annotate gcc/testsuite/gcc.dg/vect/pr65518.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 #include "tree-vect.h"
kono
parents:
diff changeset
2
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
3 #if VECTOR_BITS > 256
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
4 #define NINTS (VECTOR_BITS / 32)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
5 #else
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
6 #define NINTS 8
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
7 #endif
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
8
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 #define N (NINTS * 2)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
10 #define RESULT (NINTS * (NINTS - 1) / 2 * N + NINTS)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
11
111
kono
parents:
diff changeset
12 extern void abort (void);
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 typedef struct giga
kono
parents:
diff changeset
15 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
16 unsigned int g[N];
111
kono
parents:
diff changeset
17 } giga;
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 unsigned long __attribute__((noinline,noclone))
kono
parents:
diff changeset
20 addfst(giga const *gptr, int num)
kono
parents:
diff changeset
21 {
kono
parents:
diff changeset
22 unsigned int retval = 0;
kono
parents:
diff changeset
23 int i;
kono
parents:
diff changeset
24 for (i = 0; i < num; i++)
kono
parents:
diff changeset
25 retval += gptr[i].g[0];
kono
parents:
diff changeset
26 return retval;
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 int main ()
kono
parents:
diff changeset
30 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
31 struct giga g[NINTS];
111
kono
parents:
diff changeset
32 unsigned int n = 1;
kono
parents:
diff changeset
33 int i, j;
kono
parents:
diff changeset
34 check_vect ();
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
35 for (i = 0; i < NINTS; ++i)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
36 for (j = 0; j < N; ++j)
111
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 g[i].g[j] = n++;
kono
parents:
diff changeset
39 __asm__ volatile ("");
kono
parents:
diff changeset
40 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
41 if (addfst (g, NINTS) != RESULT)
111
kono
parents:
diff changeset
42 abort ();
kono
parents:
diff changeset
43 return 0;
kono
parents:
diff changeset
44 }
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 /* We don't want to vectorize the single-element interleaving in the way
kono
parents:
diff changeset
47 we currently do that (without ignoring not needed vectors in the
kono
parents:
diff changeset
48 gap between gptr[0].g[0] and gptr[1].g[0]), because that's very
kono
parents:
diff changeset
49 sub-optimal and causes memory explosion (even though the cost model
kono
parents:
diff changeset
50 should reject that in the end). */
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 /* { dg-final { scan-tree-dump-times "vectorized 0 loops in function" 2 "vect" } } */