annotate gcc/gimple-fold.h @ 140:4e440907fcbf

copy CbC goto flang in cfgexpand remove some CbC unnecessary code
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Nov 2018 00:24:45 +0900
parents 84e7813d76e9
children 1830386684a0
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
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
3 Copyright (C) 2011-2018 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);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 extern bool get_range_strlen (tree, tree[2], unsigned = 1,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
29 bool = false, tree * = NULL);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
30 extern tree get_maxval_strlen (tree, int, tree * = NULL);
111
kono
parents:
diff changeset
31 extern void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
kono
parents:
diff changeset
32 extern bool fold_stmt (gimple_stmt_iterator *);
kono
parents:
diff changeset
33 extern bool fold_stmt (gimple_stmt_iterator *, tree (*) (tree));
kono
parents:
diff changeset
34 extern bool fold_stmt_inplace (gimple_stmt_iterator *);
kono
parents:
diff changeset
35 extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree,
kono
parents:
diff changeset
36 enum tree_code, tree, tree);
kono
parents:
diff changeset
37 extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
kono
parents:
diff changeset
38 enum tree_code, tree, tree);
kono
parents:
diff changeset
39 extern bool optimize_atomic_compare_exchange_p (gimple *);
kono
parents:
diff changeset
40 extern void fold_builtin_atomic_compare_exchange (gimple_stmt_iterator *);
kono
parents:
diff changeset
41 extern bool arith_overflowed_p (enum tree_code, const_tree, const_tree,
kono
parents:
diff changeset
42 const_tree);
kono
parents:
diff changeset
43 extern tree no_follow_ssa_edges (tree);
kono
parents:
diff changeset
44 extern tree follow_single_use_edges (tree);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
45 extern tree follow_all_ssa_edges (tree);
111
kono
parents:
diff changeset
46 extern tree gimple_fold_stmt_to_constant_1 (gimple *, tree (*) (tree),
kono
parents:
diff changeset
47 tree (*) (tree) = no_follow_ssa_edges);
kono
parents:
diff changeset
48 extern tree gimple_fold_stmt_to_constant (gimple *, tree (*) (tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
49 extern tree fold_ctor_reference (tree, tree, const poly_uint64&,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
50 const poly_uint64&, tree,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
51 unsigned HOST_WIDE_INT * = NULL);
111
kono
parents:
diff changeset
52 extern tree fold_const_aggregate_ref_1 (tree, tree (*) (tree));
kono
parents:
diff changeset
53 extern tree fold_const_aggregate_ref (tree);
kono
parents:
diff changeset
54 extern tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree,
kono
parents:
diff changeset
55 bool *can_refer = NULL);
kono
parents:
diff changeset
56 extern tree gimple_get_virt_method_for_vtable (HOST_WIDE_INT, tree,
kono
parents:
diff changeset
57 unsigned HOST_WIDE_INT,
kono
parents:
diff changeset
58 bool *can_refer = NULL);
kono
parents:
diff changeset
59 extern tree gimple_fold_indirect_ref (tree);
kono
parents:
diff changeset
60 extern bool gimple_fold_builtin_sprintf (gimple_stmt_iterator *);
kono
parents:
diff changeset
61 extern bool gimple_fold_builtin_snprintf (gimple_stmt_iterator *);
kono
parents:
diff changeset
62 extern bool arith_code_with_undefined_signed_overflow (tree_code);
kono
parents:
diff changeset
63 extern gimple_seq rewrite_to_defined_overflow (gimple *);
kono
parents:
diff changeset
64 extern void replace_call_with_value (gimple_stmt_iterator *, tree);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
65 extern tree tree_vec_extract (gimple_stmt_iterator *, tree, tree, tree, tree);
111
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 /* gimple_build, functionally matching fold_buildN, outputs stmts
kono
parents:
diff changeset
68 int the provided sequence, matching and simplifying them on-the-fly.
kono
parents:
diff changeset
69 Supposed to replace force_gimple_operand (fold_buildN (...), ...). */
kono
parents:
diff changeset
70 extern tree gimple_build (gimple_seq *, location_t,
kono
parents:
diff changeset
71 enum tree_code, tree, tree);
kono
parents:
diff changeset
72 inline tree
kono
parents:
diff changeset
73 gimple_build (gimple_seq *seq,
kono
parents:
diff changeset
74 enum tree_code code, tree type, tree op0)
kono
parents:
diff changeset
75 {
kono
parents:
diff changeset
76 return gimple_build (seq, UNKNOWN_LOCATION, code, type, op0);
kono
parents:
diff changeset
77 }
kono
parents:
diff changeset
78 extern tree gimple_build (gimple_seq *, location_t,
kono
parents:
diff changeset
79 enum tree_code, tree, tree, tree);
kono
parents:
diff changeset
80 inline tree
kono
parents:
diff changeset
81 gimple_build (gimple_seq *seq,
kono
parents:
diff changeset
82 enum tree_code code, tree type, tree op0, tree op1)
kono
parents:
diff changeset
83 {
kono
parents:
diff changeset
84 return gimple_build (seq, UNKNOWN_LOCATION, code, type, op0, op1);
kono
parents:
diff changeset
85 }
kono
parents:
diff changeset
86 extern tree gimple_build (gimple_seq *, location_t,
kono
parents:
diff changeset
87 enum tree_code, tree, tree, tree, tree);
kono
parents:
diff changeset
88 inline tree
kono
parents:
diff changeset
89 gimple_build (gimple_seq *seq,
kono
parents:
diff changeset
90 enum tree_code code, tree type, tree op0, tree op1, tree op2)
kono
parents:
diff changeset
91 {
kono
parents:
diff changeset
92 return gimple_build (seq, UNKNOWN_LOCATION, code, type, op0, op1, op2);
kono
parents:
diff changeset
93 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
94 extern tree gimple_build (gimple_seq *, location_t, combined_fn, tree, tree);
111
kono
parents:
diff changeset
95 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
96 gimple_build (gimple_seq *seq, combined_fn fn, tree type, tree arg0)
111
kono
parents:
diff changeset
97 {
kono
parents:
diff changeset
98 return gimple_build (seq, UNKNOWN_LOCATION, fn, type, arg0);
kono
parents:
diff changeset
99 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
100 extern tree gimple_build (gimple_seq *, location_t, combined_fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
101 tree, tree, tree);
111
kono
parents:
diff changeset
102 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
103 gimple_build (gimple_seq *seq, combined_fn fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
104 tree type, tree arg0, tree arg1)
111
kono
parents:
diff changeset
105 {
kono
parents:
diff changeset
106 return gimple_build (seq, UNKNOWN_LOCATION, fn, type, arg0, arg1);
kono
parents:
diff changeset
107 }
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
108 extern tree gimple_build (gimple_seq *, location_t, combined_fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
109 tree, tree, tree, tree);
111
kono
parents:
diff changeset
110 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
111 gimple_build (gimple_seq *seq, combined_fn fn,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
112 tree type, tree arg0, tree arg1, tree arg2)
111
kono
parents:
diff changeset
113 {
kono
parents:
diff changeset
114 return gimple_build (seq, UNKNOWN_LOCATION, fn, type, arg0, arg1, arg2);
kono
parents:
diff changeset
115 }
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 extern tree gimple_convert (gimple_seq *, location_t, tree, tree);
kono
parents:
diff changeset
118 inline tree
kono
parents:
diff changeset
119 gimple_convert (gimple_seq *seq, tree type, tree op)
kono
parents:
diff changeset
120 {
kono
parents:
diff changeset
121 return gimple_convert (seq, UNKNOWN_LOCATION, type, op);
kono
parents:
diff changeset
122 }
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 extern tree gimple_convert_to_ptrofftype (gimple_seq *, location_t, tree);
kono
parents:
diff changeset
125 inline tree
kono
parents:
diff changeset
126 gimple_convert_to_ptrofftype (gimple_seq *seq, tree op)
kono
parents:
diff changeset
127 {
kono
parents:
diff changeset
128 return gimple_convert_to_ptrofftype (seq, UNKNOWN_LOCATION, op);
kono
parents:
diff changeset
129 }
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 extern tree gimple_build_vector_from_val (gimple_seq *, location_t, tree,
kono
parents:
diff changeset
132 tree);
kono
parents:
diff changeset
133 inline tree
kono
parents:
diff changeset
134 gimple_build_vector_from_val (gimple_seq *seq, tree type, tree op)
kono
parents:
diff changeset
135 {
kono
parents:
diff changeset
136 return gimple_build_vector_from_val (seq, UNKNOWN_LOCATION, type, op);
kono
parents:
diff changeset
137 }
kono
parents:
diff changeset
138
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
139 class tree_vector_builder;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
140 extern tree gimple_build_vector (gimple_seq *, location_t,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
141 tree_vector_builder *);
111
kono
parents:
diff changeset
142 inline tree
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
143 gimple_build_vector (gimple_seq *seq, tree_vector_builder *builder)
111
kono
parents:
diff changeset
144 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
145 return gimple_build_vector (seq, UNKNOWN_LOCATION, builder);
111
kono
parents:
diff changeset
146 }
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 extern bool gimple_stmt_nonnegative_warnv_p (gimple *, bool *, int = 0);
kono
parents:
diff changeset
149 extern bool gimple_stmt_integer_valued_real_p (gimple *, int = 0);
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 /* In gimple-match.c. */
kono
parents:
diff changeset
152 extern tree gimple_simplify (enum tree_code, tree, tree,
kono
parents:
diff changeset
153 gimple_seq *, tree (*)(tree));
kono
parents:
diff changeset
154 extern tree gimple_simplify (enum tree_code, tree, tree, tree,
kono
parents:
diff changeset
155 gimple_seq *, tree (*)(tree));
kono
parents:
diff changeset
156 extern tree gimple_simplify (enum tree_code, tree, tree, tree, tree,
kono
parents:
diff changeset
157 gimple_seq *, tree (*)(tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
158 extern tree gimple_simplify (combined_fn, tree, tree,
111
kono
parents:
diff changeset
159 gimple_seq *, tree (*)(tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
160 extern tree gimple_simplify (combined_fn, tree, tree, tree,
111
kono
parents:
diff changeset
161 gimple_seq *, tree (*)(tree));
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
162 extern tree gimple_simplify (combined_fn, tree, tree, tree, tree,
111
kono
parents:
diff changeset
163 gimple_seq *, tree (*)(tree));
kono
parents:
diff changeset
164
kono
parents:
diff changeset
165 #endif /* GCC_GIMPLE_FOLD_H */