annotate gcc/testsuite/gcc.dg/vect/pr65947-6.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 30
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 /* Condition reduction where loop type is different than the data type. */
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 + 65;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 for (char i = 0; i < N; i++)
kono
parents:
diff changeset
17 if (a[i] < min_v)
kono
parents:
diff changeset
18 last = a[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
kono
parents:
diff changeset
24 int
kono
parents:
diff changeset
25 main (void)
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 int a[N] = {
kono
parents:
diff changeset
28 67, 32, 45, 43, 21, -11, 12, 3, 4, 5,
kono
parents:
diff changeset
29 6, 76, -32, 56, -32, -1, 4, 5, 6, 99,
kono
parents:
diff changeset
30 43, 22, -3, 22, 16, 34, 55, 31, 87, 324
kono
parents:
diff changeset
31 };
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 check_vect ();
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 int ret = condition_reduction (a, 16);
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 if (ret != -3)
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 } } } */
111
kono
parents:
diff changeset
45 /* { dg-final { scan-tree-dump-not "condition expression based on integer induction." "vect" } } */