annotate gcc/gimple-fold.h @ 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 /* Gimple folding definitions.
kono
parents:
diff changeset
2
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3 Copyright (C) 2011-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
4 Contributed by Richard Guenther <rguenther@suse.de>
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
9 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
10 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
11 version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
16 for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #ifndef GCC_GIMPLE_FOLD_H
kono
parents:
diff changeset
23 #define GCC_GIMPLE_FOLD_H
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 extern tree create_tmp_reg_or_ssa_name (tree, gimple *stmt = NULL);
kono
parents:
diff changeset
26 extern tree canonicalize_constructor_val (tree, tree);
kono
parents:
diff changeset
27 extern tree get_symbol_constant_value (tree);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
28 struct c_strlen_data;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
29 extern bool get_range_strlen (tree, c_strlen_data *, unsigned eltsize);
111
kono
parents:
diff changeset
30 extern void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
kono
parents:
diff changeset
31 extern bool fold_stmt (gimple_stmt_iterator *);
kono
parents:
diff changeset
32 extern bool fold_stmt (gimple_stmt_iterator *, tree (*) (tree));
kono
parents:
diff changeset
33 extern bool fold_stmt_inplace (gimple_stmt_iterator *);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
34 extern tree maybe_fold_and_comparisons (tree, enum tree_code, tree, tree,
111
kono
parents:
diff changeset
35 enum tree_code, tree, tree);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
36 extern tree maybe_fold_or_comparisons (tree, enum tree_code, tree, tree,
111
kono
parents:
diff changeset
37 enum tree_code, tree, tree);
kono
parents:
diff changeset
38 extern bool optimize_atomic_compare_exchange_p (gimple *);
kono
parents:
diff changeset
39 extern void fold_builtin_atomic_compare_exchange (gimple_stmt_iterator *);
kono
parents:
diff changeset
40 extern bool arith_overflowed_p (enum tree_code, const_tree, const_tree,
kono
parents:
diff changeset
41 const_tree);
kono
parents:
diff changeset
42 extern tree no_follow_ssa_edges (tree);
kono
parents:
diff changeset
43 extern tree follow_single_use_edges (tree);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
44 extern tree follow_all_ssa_edges (tree);
111
kono
parents:
diff changeset
45 extern tree gimple_fold_stmt_to_constant_1 (gimple *, tree (*) (tree),
kono
parents:
diff changeset
46 tree (*) (tree) = no_follow_ssa_edges);
kono
parents:
diff changeset
47 extern tree gimple_fold_stmt_to_constant (gimple *, tree (*) (tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
48 extern tree fold_ctor_reference (tree, tree, const poly_uint64&,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
49 const poly_uint64&, tree,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
50 unsigned HOST_WIDE_INT * = NULL);
111
kono
parents:
diff changeset
51 extern tree fold_const_aggregate_ref_1 (tree, tree (*) (tree));
kono
parents:
diff changeset
52 extern tree fold_const_aggregate_ref (tree);
kono
parents:
diff changeset
53 extern tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree,
kono
parents:
diff changeset
54 bool *can_refer = NULL);
kono
parents:
diff changeset
55 extern tree gimple_get_virt_method_for_vtable (HOST_WIDE_INT, tree,
kono
parents:
diff changeset
56 unsigned HOST_WIDE_INT,
kono
parents:
diff changeset
57 bool *can_refer = NULL);
kono
parents:
diff changeset
58 extern tree gimple_fold_indirect_ref (tree);
kono
parents:
diff changeset
59 extern bool gimple_fold_builtin_sprintf (gimple_stmt_iterator *);
kono
parents:
diff changeset
60 extern bool gimple_fold_builtin_snprintf (gimple_stmt_iterator *);
kono
parents:
diff changeset
61 extern bool arith_code_with_undefined_signed_overflow (tree_code);
kono
parents:
diff changeset
62 extern gimple_seq rewrite_to_defined_overflow (gimple *);
kono
parents:
diff changeset
63 extern void replace_call_with_value (gimple_stmt_iterator *, tree);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
64 extern tree tree_vec_extract (gimple_stmt_iterator *, tree, tree, tree, tree);
111
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 /* gimple_build, functionally matching fold_buildN, outputs stmts
kono
parents:
diff changeset
67 int the provided sequence, matching and simplifying them on-the-fly.
kono
parents:
diff changeset
68 Supposed to replace force_gimple_operand (fold_buildN (...), ...). */
kono
parents:
diff changeset
69 extern tree gimple_build (gimple_seq *, location_t,
kono
parents:
diff changeset
70 enum tree_code, tree, tree);
kono
parents:
diff changeset
71 inline tree
kono
parents:
diff changeset
72 gimple_build (gimple_seq *seq,
kono
parents:
diff changeset
73 enum tree_code code, tree type, tree op0)
kono
parents:
diff changeset
74 {
kono
parents:
diff changeset
75 return gimple_build (seq, UNKNOWN_LOCATION, code, type, op0);
kono
parents:
diff changeset
76 }
kono
parents:
diff changeset
77 extern tree gimple_build (gimple_seq *, location_t,
kono
parents:
diff changeset
78 enum tree_code, tree, tree, tree);
kono
parents:
diff changeset
79 inline tree
kono
parents:
diff changeset
80 gimple_build (gimple_seq *seq,
kono
parents:
diff changeset
81 enum tree_code code, tree type, tree op0, tree op1)
kono
parents:
diff changeset
82 {
kono
parents:
diff changeset
83 return gimple_build (seq, UNKNOWN_LOCATION, code, type, op0, op1);
kono
parents:
diff changeset
84 }
kono
parents:
diff changeset
85 extern tree gimple_build (gimple_seq *, location_t,
kono
parents:
diff changeset
86 enum tree_code, tree, tree, tree, tree);
kono
parents:
diff changeset
87 inline tree
kono
parents:
diff changeset
88 gimple_build (gimple_seq *seq,
kono
parents:
diff changeset
89 enum tree_code code, tree type, tree op0, tree op1, tree op2)
kono
parents:
diff changeset
90 {
kono
parents:
diff changeset
91 return gimple_build (seq, UNKNOWN_LOCATION, code, type, op0, op1, op2);
kono
parents:
diff changeset
92 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
93 extern tree gimple_build (gimple_seq *, location_t, combined_fn, tree, tree);
111
kono
parents:
diff changeset
94 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
95 gimple_build (gimple_seq *seq, combined_fn fn, tree type, tree arg0)
111
kono
parents:
diff changeset
96 {
kono
parents:
diff changeset
97 return gimple_build (seq, UNKNOWN_LOCATION, fn, type, arg0);
kono
parents:
diff changeset
98 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
99 extern tree gimple_build (gimple_seq *, location_t, combined_fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
100 tree, tree, tree);
111
kono
parents:
diff changeset
101 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
102 gimple_build (gimple_seq *seq, combined_fn fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
103 tree type, tree arg0, tree arg1)
111
kono
parents:
diff changeset
104 {
kono
parents:
diff changeset
105 return gimple_build (seq, UNKNOWN_LOCATION, fn, type, arg0, arg1);
kono
parents:
diff changeset
106 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
107 extern tree gimple_build (gimple_seq *, location_t, combined_fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
108 tree, tree, tree, tree);
111
kono
parents:
diff changeset
109 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
110 gimple_build (gimple_seq *seq, combined_fn fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
111 tree type, tree arg0, tree arg1, tree arg2)
111
kono
parents:
diff changeset
112 {
kono
parents:
diff changeset
113 return gimple_build (seq, UNKNOWN_LOCATION, fn, type, arg0, arg1, arg2);
kono
parents:
diff changeset
114 }
kono
parents:
diff changeset
115
kono
parents:
diff changeset
116 extern tree gimple_convert (gimple_seq *, location_t, tree, tree);
kono
parents:
diff changeset
117 inline tree
kono
parents:
diff changeset
118 gimple_convert (gimple_seq *seq, tree type, tree op)
kono
parents:
diff changeset
119 {
kono
parents:
diff changeset
120 return gimple_convert (seq, UNKNOWN_LOCATION, type, op);
kono
parents:
diff changeset
121 }
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 extern tree gimple_convert_to_ptrofftype (gimple_seq *, location_t, tree);
kono
parents:
diff changeset
124 inline tree
kono
parents:
diff changeset
125 gimple_convert_to_ptrofftype (gimple_seq *seq, tree op)
kono
parents:
diff changeset
126 {
kono
parents:
diff changeset
127 return gimple_convert_to_ptrofftype (seq, UNKNOWN_LOCATION, op);
kono
parents:
diff changeset
128 }
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 extern tree gimple_build_vector_from_val (gimple_seq *, location_t, tree,
kono
parents:
diff changeset
131 tree);
kono
parents:
diff changeset
132 inline tree
kono
parents:
diff changeset
133 gimple_build_vector_from_val (gimple_seq *seq, tree type, tree op)
kono
parents:
diff changeset
134 {
kono
parents:
diff changeset
135 return gimple_build_vector_from_val (seq, UNKNOWN_LOCATION, type, op);
kono
parents:
diff changeset
136 }
kono
parents:
diff changeset
137
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
138 class tree_vector_builder;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
139 extern tree gimple_build_vector (gimple_seq *, location_t,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
140 tree_vector_builder *);
111
kono
parents:
diff changeset
141 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
142 gimple_build_vector (gimple_seq *seq, tree_vector_builder *builder)
111
kono
parents:
diff changeset
143 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
144 return gimple_build_vector (seq, UNKNOWN_LOCATION, builder);
111
kono
parents:
diff changeset
145 }
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 extern bool gimple_stmt_nonnegative_warnv_p (gimple *, bool *, int = 0);
kono
parents:
diff changeset
148 extern bool gimple_stmt_integer_valued_real_p (gimple *, int = 0);
kono
parents:
diff changeset
149
kono
parents:
diff changeset
150 /* In gimple-match.c. */
kono
parents:
diff changeset
151 extern tree gimple_simplify (enum tree_code, tree, tree,
kono
parents:
diff changeset
152 gimple_seq *, tree (*)(tree));
kono
parents:
diff changeset
153 extern tree gimple_simplify (enum tree_code, tree, tree, tree,
kono
parents:
diff changeset
154 gimple_seq *, tree (*)(tree));
kono
parents:
diff changeset
155 extern tree gimple_simplify (enum tree_code, tree, tree, tree, tree,
kono
parents:
diff changeset
156 gimple_seq *, tree (*)(tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
157 extern tree gimple_simplify (combined_fn, tree, tree,
111
kono
parents:
diff changeset
158 gimple_seq *, tree (*)(tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
159 extern tree gimple_simplify (combined_fn, tree, tree, tree,
111
kono
parents:
diff changeset
160 gimple_seq *, tree (*)(tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
161 extern tree gimple_simplify (combined_fn, tree, tree, tree, tree,
111
kono
parents:
diff changeset
162 gimple_seq *, tree (*)(tree));
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 #endif /* GCC_GIMPLE_FOLD_H */