]>
Commit | Line | Data |
---|---|---|
3d2cf79f | 1 | /* Preamble and helpers for the autogenerated generic-match.c file. |
99dee823 | 2 | Copyright (C) 2014-2021 Free Software Foundation, Inc. |
3d2cf79f RB |
3 | |
4 | This file is part of GCC. | |
5 | ||
6 | GCC is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 3, or (at your option) any later | |
9 | version. | |
10 | ||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GCC; see the file COPYING3. If not see | |
18 | <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #include "config.h" | |
21 | #include "system.h" | |
22 | #include "coretypes.h" | |
c7131fb2 | 23 | #include "backend.h" |
957060b5 AM |
24 | #include "target.h" |
25 | #include "rtl.h" | |
3d2cf79f | 26 | #include "tree.h" |
c7131fb2 | 27 | #include "gimple.h" |
c7131fb2 | 28 | #include "ssa.h" |
957060b5 | 29 | #include "cgraph.h" |
ebd733a7 | 30 | #include "vec-perm-indices.h" |
40e23961 | 31 | #include "fold-const.h" |
0043b528 | 32 | #include "fold-const-call.h" |
3d2cf79f | 33 | #include "stor-layout.h" |
3d2cf79f RB |
34 | #include "tree-dfa.h" |
35 | #include "builtins.h" | |
c9e926ce | 36 | #include "case-cfn-macros.h" |
e1201dff | 37 | #include "gimplify.h" |
71f82be9 | 38 | #include "optabs-tree.h" |
d398999d | 39 | #include "dbgcnt.h" |
75f89001 | 40 | #include "tm.h" |
d057c866 | 41 | |
48451e8f | 42 | /* Routine to determine if the types T1 and T2 are effectively |
aea417d7 MG |
43 | the same for GENERIC. If T1 or T2 is not a type, the test |
44 | applies to their TREE_TYPE. */ | |
3d2cf79f | 45 | |
48451e8f JL |
46 | static inline bool |
47 | types_match (tree t1, tree t2) | |
48 | { | |
aea417d7 MG |
49 | if (!TYPE_P (t1)) |
50 | t1 = TREE_TYPE (t1); | |
51 | if (!TYPE_P (t2)) | |
52 | t2 = TREE_TYPE (t2); | |
53 | ||
48451e8f JL |
54 | return TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2); |
55 | } | |
56 | ||
57 | /* Return if T has a single use. For GENERIC, we assume this is | |
58 | always true. */ | |
59 | ||
60 | static inline bool | |
61 | single_use (tree t ATTRIBUTE_UNUSED) | |
62 | { | |
63 | return true; | |
64 | } | |
53f3cd25 RS |
65 | |
66 | /* Return true if math operations should be canonicalized, | |
67 | e.g. sqrt(sqrt(x)) -> pow(x, 0.25). */ | |
68 | ||
69 | static inline bool | |
70 | canonicalize_math_p () | |
71 | { | |
72 | return true; | |
73 | } | |
848bb6fc JJ |
74 | |
75 | /* Return true if math operations that are beneficial only after | |
76 | vectorization should be canonicalized. */ | |
77 | ||
78 | static inline bool | |
79 | canonicalize_math_after_vectorization_p () | |
80 | { | |
81 | return false; | |
82 | } | |
98610dc5 | 83 | |
a1ee6d50 MG |
84 | /* Return true if we can still perform transformations that may introduce |
85 | vector operations that are not supported by the target. Vector lowering | |
86 | normally handles those, but after that pass, it becomes unsafe. */ | |
87 | ||
88 | static inline bool | |
89 | optimize_vectors_before_lowering_p () | |
90 | { | |
91 | return true; | |
92 | } | |
93 | ||
98610dc5 JJ |
94 | /* Return true if successive divisions can be optimized. |
95 | Defer to GIMPLE opts. */ | |
96 | ||
97 | static inline bool | |
98 | optimize_successive_divisions_p (tree, tree) | |
99 | { | |
100 | return false; | |
101 | } |