annotate gcc/generic-match-head.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Preamble and helpers for the autogenerated generic-match.c file.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #include "config.h"
kono
parents:
diff changeset
21 #include "system.h"
kono
parents:
diff changeset
22 #include "coretypes.h"
kono
parents:
diff changeset
23 #include "backend.h"
kono
parents:
diff changeset
24 #include "target.h"
kono
parents:
diff changeset
25 #include "rtl.h"
kono
parents:
diff changeset
26 #include "tree.h"
kono
parents:
diff changeset
27 #include "gimple.h"
kono
parents:
diff changeset
28 #include "ssa.h"
kono
parents:
diff changeset
29 #include "cgraph.h"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
30 #include "vec-perm-indices.h"
111
kono
parents:
diff changeset
31 #include "fold-const.h"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
32 #include "fold-const-call.h"
111
kono
parents:
diff changeset
33 #include "stor-layout.h"
kono
parents:
diff changeset
34 #include "tree-dfa.h"
kono
parents:
diff changeset
35 #include "builtins.h"
kono
parents:
diff changeset
36 #include "case-cfn-macros.h"
kono
parents:
diff changeset
37 #include "gimplify.h"
kono
parents:
diff changeset
38 #include "optabs-tree.h"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
39 #include "dbgcnt.h"
111
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 /* Routine to determine if the types T1 and T2 are effectively
kono
parents:
diff changeset
42 the same for GENERIC. If T1 or T2 is not a type, the test
kono
parents:
diff changeset
43 applies to their TREE_TYPE. */
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 static inline bool
kono
parents:
diff changeset
46 types_match (tree t1, tree t2)
kono
parents:
diff changeset
47 {
kono
parents:
diff changeset
48 if (!TYPE_P (t1))
kono
parents:
diff changeset
49 t1 = TREE_TYPE (t1);
kono
parents:
diff changeset
50 if (!TYPE_P (t2))
kono
parents:
diff changeset
51 t2 = TREE_TYPE (t2);
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 return TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2);
kono
parents:
diff changeset
54 }
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 /* Return if T has a single use. For GENERIC, we assume this is
kono
parents:
diff changeset
57 always true. */
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 static inline bool
kono
parents:
diff changeset
60 single_use (tree t ATTRIBUTE_UNUSED)
kono
parents:
diff changeset
61 {
kono
parents:
diff changeset
62 return true;
kono
parents:
diff changeset
63 }
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 /* Return true if math operations should be canonicalized,
kono
parents:
diff changeset
66 e.g. sqrt(sqrt(x)) -> pow(x, 0.25). */
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 static inline bool
kono
parents:
diff changeset
69 canonicalize_math_p ()
kono
parents:
diff changeset
70 {
kono
parents:
diff changeset
71 return true;
kono
parents:
diff changeset
72 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
73
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
74 /* Return true if math operations that are beneficial only after
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
75 vectorization should be canonicalized. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
76
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
77 static inline bool
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
78 canonicalize_math_after_vectorization_p ()
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
79 {
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
80 return false;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
81 }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
82
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
83 /* Return true if successive divisions can be optimized.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
84 Defer to GIMPLE opts. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
85
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
86 static inline bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
87 optimize_successive_divisions_p (tree, tree)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
88 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
89 return false;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
90 }