annotate gcc/testsuite/gcc.dg/vect/pr65947-14.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_condition } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 #include "tree-vect.h"
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 extern void abort (void) __attribute__ ((noreturn));
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 #define N 27
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 /* Condition reduction with matches only in even lanes at runtime. */
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 int
kono
parents:
diff changeset
12 condition_reduction (int *a, int min_v)
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 int last = N + 96;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 for (int i = 0; i < N; i++)
kono
parents:
diff changeset
17 if (a[i] > min_v)
kono
parents:
diff changeset
18 last = i;
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 return last;
kono
parents:
diff changeset
21 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 int
kono
parents:
diff changeset
24 main (void)
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 int a[N] = {
kono
parents:
diff changeset
27 47, 12, 13, 14, 15, 16, 17, 18, 19, 20,
kono
parents:
diff changeset
28 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
kono
parents:
diff changeset
29 21, 22, 23, 24, 25, 26, 27
kono
parents:
diff changeset
30 };
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 check_vect ();
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 int ret = condition_reduction (a, 46);
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 /* loop should have found a value of 0, not default N + 96. */
kono
parents:
diff changeset
37 if (ret != 0)
kono
parents:
diff changeset
38 abort ();
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 return 0;
kono
parents:
diff changeset
41 }
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 /* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
44 /* { dg-final { scan-tree-dump-times "optimizing condition reduction with FOLD_EXTRACT_LAST" 4 "vect" { target vect_fold_extract_last } } } */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
45 /* { dg-final { scan-tree-dump-times "condition expression based on integer induction." 4 "vect" { target { ! vect_fold_extract_last } } } } */