]>
Commit | Line | Data |
---|---|---|
6de9cd9a DN |
1 | /* Data and Control Flow Analysis for Trees. |
2 | Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. | |
3 | Contributed by Diego Novillo <dnovillo@redhat.com> | |
4 | ||
5 | This file is part of GCC. | |
6 | ||
7 | GCC is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2, or (at your option) | |
10 | any later version. | |
11 | ||
12 | GCC is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with GCC; see the file COPYING. If not, write to | |
19 | the Free Software Foundation, 59 Temple Place - Suite 330, | |
20 | Boston, MA 02111-1307, USA. */ | |
21 | ||
22 | #ifndef _TREE_FLOW_H | |
23 | #define _TREE_FLOW_H 1 | |
24 | ||
25 | #include "bitmap.h" | |
26 | #include "hard-reg-set.h" | |
27 | #include "basic-block.h" | |
28 | #include "hashtab.h" | |
eadf906f | 29 | #include "tree-gimple.h" |
6de9cd9a DN |
30 | #include "tree-ssa-operands.h" |
31 | ||
32 | /* Forward declare structures for the garbage collector GTY markers. */ | |
33 | #ifndef GCC_BASIC_BLOCK_H | |
34 | struct edge_def; | |
35 | typedef struct edge_def *edge; | |
36 | struct basic_block_def; | |
37 | typedef struct basic_block_def *basic_block; | |
38 | #endif | |
39 | ||
40 | /*--------------------------------------------------------------------------- | |
41 | Tree annotations stored in tree_common.ann | |
42 | ---------------------------------------------------------------------------*/ | |
7e6eb623 | 43 | enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, CST_ANN, EXPR_ANN, STMT_ANN }; |
6de9cd9a DN |
44 | |
45 | struct tree_ann_common_d GTY(()) | |
46 | { | |
47 | /* Annotation type. */ | |
48 | enum tree_ann_type type; | |
7e6eb623 DB |
49 | |
50 | /* The value handle for this expression. Used by GVN-PRE. */ | |
51 | tree GTY((skip)) value_handle; | |
6de9cd9a DN |
52 | }; |
53 | ||
54 | /* It is advantageous to avoid things like life analysis for variables which | |
55 | do not need PHI nodes. This enum describes whether or not a particular | |
56 | variable may need a PHI node. */ | |
57 | ||
58 | enum need_phi_state { | |
59 | /* This is the default. If we are still in this state after finding | |
60 | all the definition and use sites, then we will assume the variable | |
61 | needs PHI nodes. This is probably an overly conservative assumption. */ | |
62 | NEED_PHI_STATE_UNKNOWN, | |
63 | ||
64 | /* This state indicates that we have seen one or more sets of the | |
65 | variable in a single basic block and that the sets dominate all | |
66 | uses seen so far. If after finding all definition and use sites | |
67 | we are still in this state, then the variable does not need any | |
68 | PHI nodes. */ | |
69 | NEED_PHI_STATE_NO, | |
70 | ||
71 | /* This state indicates that we have either seen multiple definitions of | |
72 | the variable in multiple blocks, or that we encountered a use in a | |
73 | block that was not dominated by the block containing the set(s) of | |
74 | this variable. This variable is assumed to need PHI nodes. */ | |
75 | NEED_PHI_STATE_MAYBE | |
76 | }; | |
77 | ||
78 | ||
79 | /* When computing aliasing information, we represent the memory pointed-to | |
80 | by pointers with artificial variables called "memory tags" (MT). There | |
81 | are two kinds of tags: type and name. Type tags (TMT) are used in | |
82 | type-based alias analysis, they represent all the pointed-to locations | |
83 | and variables of the same alias set class. Name tags (NMT) are used in | |
84 | flow-sensitive points-to alias analysis, they represent the variables | |
85 | and memory locations pointed-to by a specific SSA_NAME pointer. */ | |
86 | enum mem_tag_kind { | |
87 | /* This variable is not a memory tag. */ | |
88 | NOT_A_TAG, | |
89 | ||
90 | /* This variable is a type memory tag (TMT). */ | |
91 | TYPE_TAG, | |
92 | ||
93 | /* This variable is a name memory tag (NMT). */ | |
94 | NAME_TAG | |
95 | }; | |
96 | ||
97 | struct var_ann_d GTY(()) | |
98 | { | |
99 | struct tree_ann_common_d common; | |
100 | ||
101 | /* Nonzero if this variable has uses which may not appear | |
102 | in the IL. This can happen in the following cases: | |
103 | ||
104 | 1. If the variable is used in a variable length | |
105 | array declaration. | |
106 | ||
107 | 2. If the variable is the return value in a C++ | |
108 | function where the named return value optimization | |
109 | has been performed. */ | |
110 | unsigned has_hidden_use : 1; | |
111 | ||
112 | /* Used by the out of SSA pass to determine whether this variable has | |
113 | been seen yet or not. */ | |
114 | unsigned out_of_ssa_tag : 1; | |
115 | ||
116 | /* Used when building root_var structures in tree_ssa_live.[ch]. */ | |
117 | unsigned root_var_processed : 1; | |
118 | ||
119 | /* If nonzero, this variable is a memory tag. */ | |
120 | ENUM_BITFIELD (mem_tag_kind) mem_tag_kind : 2; | |
121 | ||
122 | /* Nonzero if this variable is an alias tag that represents references to | |
123 | other variables (i.e., this variable appears in the MAY_ALIASES array | |
124 | of other variables). */ | |
125 | unsigned is_alias_tag : 1; | |
126 | ||
127 | /* Nonzero if this variable was used after SSA optimizations were | |
128 | applied. We set this when translating out of SSA form. */ | |
129 | unsigned used : 1; | |
130 | ||
131 | /* This field indicates whether or not the variable may need PHI nodes. | |
132 | See the enum's definition for more detailed information about the | |
133 | states. */ | |
134 | ENUM_BITFIELD (need_phi_state) need_phi_state : 2; | |
135 | ||
136 | /* An artificial variable representing the memory location pointed-to by | |
137 | all the pointers that TBAA (type-based alias analysis) considers | |
138 | to be aliased. If the variable is not a pointer or if it is never | |
139 | dereferenced, this must be NULL. */ | |
140 | tree type_mem_tag; | |
141 | ||
142 | /* Variables that may alias this variable. */ | |
143 | varray_type may_aliases; | |
144 | ||
145 | /* Unique ID of this variable. */ | |
146 | size_t uid; | |
147 | ||
148 | /* Used when going out of SSA form to indicate which partition this | |
149 | variable represents storage for. */ | |
150 | unsigned partition; | |
151 | ||
152 | /* Used by the root-var object in tree-ssa-live.[ch]. */ | |
153 | unsigned root_index; | |
154 | ||
155 | /* Default definition for this symbol. If this field is not NULL, it | |
156 | means that the first reference to this variable in the function is a | |
157 | USE or a VUSE. In those cases, the SSA renamer creates an SSA name | |
158 | for this variable with an empty defining statement. */ | |
159 | tree default_def; | |
160 | ||
161 | /* During into-ssa and the dominator optimizer, this field holds the | |
162 | current version of this variable (an SSA_NAME). | |
163 | ||
164 | This was previously two varrays (one in into-ssa the other in the | |
165 | dominator optimizer). That is wasteful, particularly since the | |
166 | dominator optimizer calls into-ssa resulting in having two varrays | |
167 | live at the same time and this can happen for each call to the | |
168 | dominator optimizer. */ | |
169 | tree current_def; | |
7e6eb623 DB |
170 | |
171 | /* The set of expressions represented by this variable if it is a | |
172 | value handle. This is used by GVN-PRE. */ | |
173 | PTR GTY ((skip)) expr_set; | |
174 | ||
6de9cd9a DN |
175 | }; |
176 | ||
177 | ||
178 | struct dataflow_d GTY(()) | |
179 | { | |
180 | /* Immediate uses. This is a list of all the statements and PHI nodes | |
181 | that are immediately reached by the definitions made in this | |
182 | statement. */ | |
183 | varray_type immediate_uses; | |
184 | ||
185 | /* Use this array for very small numbers of uses instead of the varray. */ | |
186 | tree uses[2]; | |
187 | ||
188 | /* Reached uses. This is a list of all the possible program statements | |
189 | that may be reached directly or indirectly by definitions made in this | |
190 | statement. Notice that this is a superset of IMMEDIATE_USES. | |
191 | For instance, given the following piece of code: | |
192 | ||
193 | 1 a1 = 10; | |
194 | 2 if (a1 > 3) | |
195 | 3 a2 = a1 + 5; | |
196 | 4 a3 = PHI (a1, a2) | |
197 | 5 b1 = a3 - 2; | |
198 | ||
199 | IMMEDIATE_USES for statement #1 are all those statements that use a1 | |
200 | directly (i.e., #2, #3 and #4). REACHED_USES for statement #1 also | |
201 | includes statement #5 because 'a1' could reach 'a3' via the PHI node | |
202 | at statement #4. The set of REACHED_USES is then the transitive | |
203 | closure over all the PHI nodes in the IMMEDIATE_USES set. */ | |
204 | ||
205 | /* Reaching definitions. Similarly to REACHED_USES, the set | |
206 | REACHING_DEFS is the set of all the statements that make definitions | |
207 | that may reach this statement. Notice that we don't need to have a | |
208 | similar entry for immediate definitions, as these are represented by | |
209 | the SSA_NAME nodes themselves (each SSA_NAME node contains a pointer | |
210 | to the statement that makes that definition). */ | |
211 | }; | |
212 | ||
213 | typedef struct dataflow_d *dataflow_t; | |
214 | ||
215 | ||
216 | struct stmt_ann_d GTY(()) | |
217 | { | |
218 | struct tree_ann_common_d common; | |
219 | ||
220 | /* Nonzero if the statement has been modified (meaning that the operands | |
221 | need to be scanned again). */ | |
222 | unsigned modified : 1; | |
223 | ||
224 | /* Nonzero if the statement is in the CCP worklist and has not been | |
225 | "cancelled". If we ever need to use this bit outside CCP, then | |
226 | it should be renamed. */ | |
227 | unsigned in_ccp_worklist: 1; | |
228 | ||
229 | /* Nonzero if the statement makes aliased loads. */ | |
230 | unsigned makes_aliased_loads : 1; | |
231 | ||
232 | /* Nonzero if the statement makes aliased stores. */ | |
233 | unsigned makes_aliased_stores : 1; | |
234 | ||
235 | /* Nonzero if the statement makes references to volatile storage. */ | |
236 | unsigned has_volatile_ops : 1; | |
237 | ||
238 | /* Nonzero if the statement makes a function call that may clobber global | |
239 | and local addressable variables. */ | |
240 | unsigned makes_clobbering_call : 1; | |
241 | ||
242 | /* Basic block that contains this statement. */ | |
243 | basic_block GTY ((skip (""))) bb; | |
244 | ||
245 | /* Statement operands. */ | |
246 | struct def_optype_d * GTY (()) def_ops; | |
247 | struct use_optype_d * GTY (()) use_ops; | |
248 | ||
a32b97a2 BB |
249 | /* Virtual operands (V_MAY_DEF, VUSE, and V_MUST_DEF). */ |
250 | struct v_may_def_optype_d * GTY (()) v_may_def_ops; | |
6de9cd9a | 251 | struct vuse_optype_d * GTY (()) vuse_ops; |
a32b97a2 | 252 | struct v_must_def_optype_d * GTY (()) v_must_def_ops; |
6de9cd9a DN |
253 | |
254 | /* Dataflow information. */ | |
255 | dataflow_t df; | |
256 | ||
257 | /* Set of variables that have had their address taken in the statement. */ | |
258 | bitmap addresses_taken; | |
259 | ||
260 | /* Unique identifier for this statement. These ID's are to be created | |
261 | by each pass on an as-needed basis in any order convenient for the | |
262 | pass which needs statement UIDs. */ | |
263 | unsigned int uid; | |
264 | }; | |
265 | ||
266 | ||
7e6eb623 DB |
267 | struct cst_ann_d GTY (()) |
268 | { | |
269 | struct tree_ann_common_d common; | |
270 | ||
271 | }; | |
272 | ||
273 | struct expr_ann_d GTY(()) | |
274 | { | |
275 | struct tree_ann_common_d common; | |
276 | ||
277 | }; | |
278 | ||
279 | ||
6de9cd9a DN |
280 | union tree_ann_d GTY((desc ("ann_type ((tree_ann)&%h)"))) |
281 | { | |
282 | struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common; | |
283 | struct var_ann_d GTY((tag ("VAR_ANN"))) decl; | |
7e6eb623 DB |
284 | struct expr_ann_d GTY((tag ("EXPR_ANN"))) expr; |
285 | struct cst_ann_d GTY((tag ("CST_ANN"))) cst; | |
6de9cd9a | 286 | struct stmt_ann_d GTY((tag ("STMT_ANN"))) stmt; |
6de9cd9a DN |
287 | }; |
288 | ||
289 | typedef union tree_ann_d *tree_ann; | |
290 | typedef struct var_ann_d *var_ann_t; | |
291 | typedef struct stmt_ann_d *stmt_ann_t; | |
7e6eb623 DB |
292 | typedef struct expr_ann_d *expr_ann_t; |
293 | typedef struct cst_ann_d *cst_ann_t; | |
6de9cd9a | 294 | |
7e6eb623 DB |
295 | static inline cst_ann_t cst_ann (tree); |
296 | static inline cst_ann_t get_cst_ann (tree); | |
297 | static inline expr_ann_t expr_ann (tree); | |
298 | static inline expr_ann_t get_expr_ann (tree); | |
6de9cd9a DN |
299 | static inline var_ann_t var_ann (tree); |
300 | static inline var_ann_t get_var_ann (tree); | |
301 | static inline stmt_ann_t stmt_ann (tree); | |
302 | static inline stmt_ann_t get_stmt_ann (tree); | |
6de9cd9a DN |
303 | static inline enum tree_ann_type ann_type (tree_ann); |
304 | static inline basic_block bb_for_stmt (tree); | |
305 | extern void set_bb_for_stmt (tree, basic_block); | |
306 | static inline void modify_stmt (tree); | |
307 | static inline void unmodify_stmt (tree); | |
308 | static inline bool stmt_modified_p (tree); | |
309 | static inline varray_type may_aliases (tree); | |
310 | static inline int get_lineno (tree); | |
311 | static inline const char *get_filename (tree); | |
312 | static inline bool is_exec_stmt (tree); | |
313 | static inline bool is_label_stmt (tree); | |
a32b97a2 | 314 | static inline v_may_def_optype get_v_may_def_ops (stmt_ann_t); |
6de9cd9a DN |
315 | static inline vuse_optype get_vuse_ops (stmt_ann_t); |
316 | static inline use_optype get_use_ops (stmt_ann_t); | |
317 | static inline def_optype get_def_ops (stmt_ann_t); | |
318 | static inline bitmap addresses_taken (tree); | |
319 | static inline int num_immediate_uses (dataflow_t); | |
320 | static inline tree immediate_use (dataflow_t, int); | |
321 | static inline dataflow_t get_immediate_uses (tree); | |
322 | static inline bool has_hidden_use (tree); | |
323 | static inline void set_has_hidden_use (tree); | |
324 | static inline void set_default_def (tree, tree); | |
325 | static inline tree default_def (tree); | |
326 | static inline bool may_be_aliased (tree); | |
327 | ||
328 | /*--------------------------------------------------------------------------- | |
329 | Structure representing predictions in tree level. | |
330 | ---------------------------------------------------------------------------*/ | |
331 | struct edge_prediction GTY((chain_next ("%h.next"))) | |
332 | { | |
333 | struct edge_prediction *next; | |
334 | edge edge; | |
335 | enum br_predictor predictor; | |
336 | int probability; | |
337 | }; | |
338 | ||
339 | /*--------------------------------------------------------------------------- | |
340 | Block annotations stored in basic_block.tree_annotations | |
341 | ---------------------------------------------------------------------------*/ | |
342 | struct bb_ann_d GTY(()) | |
343 | { | |
344 | /* Chain of PHI nodes for this block. */ | |
345 | tree phi_nodes; | |
346 | ||
347 | /* Chain of EPHI nodes created in this block. */ | |
348 | tree ephi_nodes; | |
349 | ||
350 | /* Number of predecessors for this block. This is only valid during | |
351 | SSA rewriting. It is not maintained after conversion into SSA form. */ | |
352 | int num_preds; | |
353 | ||
354 | /* Nonzero if this block is forwardable during cfg cleanups. This is also | |
355 | used to detect loops during cfg cleanups. */ | |
356 | unsigned forwardable: 1; | |
357 | ||
358 | /* Nonzero if this block contains an escape point (see is_escape_site). */ | |
359 | unsigned has_escape_site : 1; | |
360 | ||
361 | struct edge_prediction *predictions; | |
362 | }; | |
363 | ||
364 | typedef struct bb_ann_d *bb_ann_t; | |
365 | ||
366 | /* Accessors for basic block annotations. */ | |
367 | static inline bb_ann_t bb_ann (basic_block); | |
368 | static inline tree phi_nodes (basic_block); | |
369 | static inline void set_phi_nodes (basic_block, tree); | |
370 | ||
371 | /*--------------------------------------------------------------------------- | |
372 | Global declarations | |
373 | ---------------------------------------------------------------------------*/ | |
374 | /* Array of all variables referenced in the function. */ | |
375 | extern GTY(()) varray_type referenced_vars; | |
376 | ||
377 | #define num_referenced_vars VARRAY_ACTIVE_SIZE (referenced_vars) | |
378 | #define referenced_var(i) VARRAY_TREE (referenced_vars, i) | |
379 | ||
95a3742c DN |
380 | /* Array of all SSA_NAMEs used in the function. */ |
381 | extern GTY(()) varray_type ssa_names; | |
382 | ||
383 | #define num_ssa_names VARRAY_ACTIVE_SIZE (ssa_names) | |
384 | #define ssa_name(i) VARRAY_TREE (ssa_names, i) | |
385 | ||
6de9cd9a DN |
386 | /* Artificial variable used to model the effects of function calls. */ |
387 | extern GTY(()) tree global_var; | |
388 | ||
389 | /* Call clobbered variables in the function. If bit I is set, then | |
390 | REFERENCED_VARS (I) is call-clobbered. */ | |
391 | extern bitmap call_clobbered_vars; | |
392 | ||
393 | /* 'true' after aliases have been computed (see compute_may_aliases). */ | |
394 | extern bool aliases_computed_p; | |
395 | ||
396 | /* Macros for showing usage statistics. */ | |
397 | #define SCALE(x) ((unsigned long) ((x) < 1024*10 \ | |
398 | ? (x) \ | |
399 | : ((x) < 1024*1024*10 \ | |
400 | ? (x) / 1024 \ | |
401 | : (x) / (1024*1024)))) | |
402 | ||
403 | #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M')) | |
404 | ||
405 | #define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y)) | |
406 | ||
407 | ||
408 | /*--------------------------------------------------------------------------- | |
409 | Block iterators | |
410 | ---------------------------------------------------------------------------*/ | |
411 | ||
412 | typedef struct { | |
413 | tree_stmt_iterator tsi; | |
414 | basic_block bb; | |
415 | } block_stmt_iterator; | |
416 | ||
417 | static inline block_stmt_iterator bsi_start (basic_block); | |
418 | static inline block_stmt_iterator bsi_last (basic_block); | |
d7621d3c | 419 | static inline block_stmt_iterator bsi_after_labels (basic_block); |
6de9cd9a DN |
420 | static inline bool bsi_end_p (block_stmt_iterator); |
421 | static inline void bsi_next (block_stmt_iterator *); | |
422 | static inline void bsi_prev (block_stmt_iterator *); | |
423 | static inline tree bsi_stmt (block_stmt_iterator); | |
424 | static inline tree * bsi_stmt_ptr (block_stmt_iterator); | |
425 | ||
426 | extern void bsi_remove (block_stmt_iterator *); | |
427 | extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *); | |
428 | extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *); | |
429 | extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block); | |
430 | ||
431 | enum bsi_iterator_update | |
432 | { | |
433 | /* Note that these are intentionally in the same order as TSI_FOO. They | |
434 | mean exactly the same as their TSI_* counterparts. */ | |
435 | BSI_NEW_STMT, | |
436 | BSI_SAME_STMT, | |
437 | BSI_CHAIN_START, | |
438 | BSI_CHAIN_END, | |
439 | BSI_CONTINUE_LINKING | |
440 | }; | |
441 | ||
442 | extern void bsi_insert_before (block_stmt_iterator *, tree, | |
443 | enum bsi_iterator_update); | |
444 | extern void bsi_insert_after (block_stmt_iterator *, tree, | |
445 | enum bsi_iterator_update); | |
446 | ||
447 | extern void bsi_replace (const block_stmt_iterator *, tree, bool); | |
448 | ||
449 | /*--------------------------------------------------------------------------- | |
450 | Function prototypes | |
451 | ---------------------------------------------------------------------------*/ | |
452 | /* In tree-cfg.c */ | |
453 | ||
454 | /* Location to track pending stmt for edge insertion. */ | |
455 | #define PENDING_STMT(e) ((e)->insns.t) | |
456 | ||
457 | extern void delete_tree_cfg (void); | |
458 | extern void disband_implicit_edges (void); | |
459 | extern bool stmt_ends_bb_p (tree); | |
460 | extern bool is_ctrl_stmt (tree); | |
461 | extern bool is_ctrl_altering_stmt (tree); | |
462 | extern bool computed_goto_p (tree); | |
463 | extern bool simple_goto_p (tree); | |
464 | extern void tree_dump_bb (basic_block, FILE *, int); | |
465 | extern void debug_tree_bb (basic_block); | |
466 | extern basic_block debug_tree_bb_n (int); | |
467 | extern void dump_tree_cfg (FILE *, int); | |
468 | extern void debug_tree_cfg (int); | |
469 | extern void dump_cfg_stats (FILE *); | |
470 | extern void debug_cfg_stats (void); | |
471 | extern void debug_loop_ir (void); | |
472 | extern void print_loop_ir (FILE *); | |
473 | extern void cleanup_tree_cfg (void); | |
474 | extern tree first_stmt (basic_block); | |
475 | extern tree last_stmt (basic_block); | |
476 | extern tree *last_stmt_ptr (basic_block); | |
477 | extern tree last_and_only_stmt (basic_block); | |
478 | extern edge find_taken_edge (basic_block, tree); | |
479 | extern void cfg_remove_useless_stmts (void); | |
480 | extern edge thread_edge (edge, basic_block); | |
481 | extern basic_block label_to_block (tree); | |
482 | extern void tree_optimize_tail_calls (bool, enum tree_dump_index); | |
483 | extern edge tree_block_forwards_to (basic_block bb); | |
484 | extern void bsi_insert_on_edge (edge, tree); | |
485 | extern void bsi_commit_edge_inserts (int *); | |
486 | extern void notice_special_calls (tree); | |
487 | extern void clear_special_calls (void); | |
488 | extern void compute_dominance_frontiers (bitmap *); | |
489 | extern void verify_stmts (void); | |
d7621d3c | 490 | extern tree tree_block_label (basic_block bb); |
6de9cd9a DN |
491 | extern void extract_true_false_edges_from_block (basic_block, edge *, edge *); |
492 | ||
493 | /* In tree-pretty-print.c. */ | |
494 | extern void dump_generic_bb (FILE *, basic_block, int, int); | |
495 | ||
496 | /* In tree-dfa.c */ | |
497 | extern var_ann_t create_var_ann (tree); | |
7e6eb623 DB |
498 | extern cst_ann_t create_cst_ann (tree); |
499 | extern expr_ann_t create_expr_ann (tree); | |
6de9cd9a | 500 | extern stmt_ann_t create_stmt_ann (tree); |
6de9cd9a DN |
501 | extern tree create_phi_node (tree, basic_block); |
502 | extern void add_phi_arg (tree *, tree, edge); | |
503 | extern void remove_phi_arg (tree, basic_block); | |
504 | extern void remove_phi_arg_num (tree, int); | |
505 | extern void remove_phi_node (tree, tree, basic_block); | |
506 | extern void remove_all_phi_nodes_for (bitmap); | |
507 | extern void dump_dfa_stats (FILE *); | |
508 | extern void debug_dfa_stats (void); | |
509 | extern void debug_referenced_vars (void); | |
510 | extern void dump_referenced_vars (FILE *); | |
511 | extern void dump_variable (FILE *, tree); | |
512 | extern void debug_variable (tree); | |
513 | extern void dump_immediate_uses (FILE *); | |
514 | extern void debug_immediate_uses (void); | |
515 | extern void dump_immediate_uses_for (FILE *, tree); | |
516 | extern void debug_immediate_uses_for (tree); | |
517 | extern void compute_immediate_uses (int, bool (*)(tree)); | |
518 | extern void free_df (void); | |
519 | extern tree get_virtual_var (tree); | |
520 | extern void add_referenced_tmp_var (tree var); | |
521 | extern void mark_new_vars_to_rename (tree, bitmap); | |
522 | extern void redirect_immediate_uses (tree, tree); | |
571325db | 523 | extern tree make_rename_temp (tree, const char *); |
6de9cd9a DN |
524 | |
525 | /* Flags used when computing reaching definitions and reached uses. */ | |
526 | #define TDFA_USE_OPS 1 << 0 | |
527 | #define TDFA_USE_VOPS 1 << 1 | |
528 | ||
529 | /* In gimple-low.c */ | |
530 | struct lower_data; | |
531 | extern void lower_stmt_body (tree, struct lower_data *); | |
532 | extern void expand_used_vars (void); | |
533 | extern void record_vars (tree); | |
534 | extern bool block_may_fallthru (tree block); | |
535 | ||
536 | /* In tree-ssa-alias.c */ | |
537 | extern void dump_may_aliases_for (FILE *, tree); | |
538 | extern void debug_may_aliases_for (tree); | |
539 | extern void dump_alias_info (FILE *); | |
540 | extern void debug_alias_info (void); | |
541 | extern void dump_points_to_info (FILE *); | |
542 | extern void debug_points_to_info (void); | |
543 | ||
544 | /* Call-back function for walk_use_def_chains(). At each reaching | |
545 | definition, a function with this prototype is called. */ | |
546 | typedef bool (*walk_use_def_chains_fn) (tree, tree, void *); | |
547 | ||
548 | /* In tree-ssa.c */ | |
549 | extern void init_tree_ssa (void); | |
550 | extern void rewrite_vars_out_of_ssa (bitmap); | |
551 | extern void dump_reaching_defs (FILE *); | |
552 | extern void debug_reaching_defs (void); | |
553 | extern void dump_tree_ssa (FILE *); | |
554 | extern void debug_tree_ssa (void); | |
555 | extern void debug_def_blocks (void); | |
556 | extern void dump_tree_ssa_stats (FILE *); | |
557 | extern void debug_tree_ssa_stats (void); | |
558 | extern void ssa_remove_edge (edge); | |
559 | extern edge ssa_redirect_edge (edge, basic_block); | |
560 | extern void set_is_used (tree); | |
561 | extern bool tree_ssa_useless_type_conversion (tree); | |
562 | extern bool tree_ssa_useless_type_conversion_1 (tree, tree); | |
563 | extern void verify_ssa (void); | |
564 | extern void delete_tree_ssa (void); | |
565 | extern void register_new_def (tree, varray_type *); | |
566 | extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *); | |
567 | ||
568 | /* In tree-into-ssa.c */ | |
569 | extern void rewrite_into_ssa (void); | |
570 | ||
6de9cd9a DN |
571 | /* In tree-ssa-pre.c */ |
572 | extern void tree_perform_ssapre (tree, enum tree_dump_index); | |
573 | ||
574 | /* In tree-ssa-ccp.c */ | |
575 | bool fold_stmt (tree *); | |
576 | tree widen_bitfield (tree, tree, tree); | |
577 | ||
578 | /* In tree-ssa-dom.c */ | |
579 | extern void dump_dominator_optimization_stats (FILE *); | |
580 | extern void debug_dominator_optimization_stats (void); | |
581 | ||
582 | /* In tree-ssa-copy.c */ | |
d00ad49b AM |
583 | extern void propagate_value (use_operand_p, tree); |
584 | extern void propagate_tree_value (tree *, tree); | |
585 | extern void replace_exp (use_operand_p, tree); | |
6de9cd9a | 586 | extern bool cprop_into_stmt (tree, varray_type); |
dd747311 | 587 | extern void cprop_into_successor_phis (basic_block, varray_type, bitmap); |
6de9cd9a DN |
588 | |
589 | /* In tree-flow-inline.h */ | |
590 | static inline int phi_arg_from_edge (tree, edge); | |
6de9cd9a DN |
591 | static inline bool may_propagate_copy (tree, tree); |
592 | static inline bool is_call_clobbered (tree); | |
593 | static inline void mark_call_clobbered (tree); | |
594 | ||
595 | /* In tree-eh.c */ | |
596 | extern void make_eh_edges (tree); | |
597 | extern bool tree_could_trap_p (tree); | |
598 | extern bool tree_could_throw_p (tree); | |
599 | extern bool tree_can_throw_internal (tree); | |
600 | extern bool tree_can_throw_external (tree); | |
601 | extern void add_stmt_to_eh_region (tree, int); | |
602 | ||
7e6eb623 DB |
603 | /* In tree-ssa-pre.c */ |
604 | tree get_value_handle (tree); | |
605 | void set_value_handle (tree, tree); | |
606 | void debug_value_expressions (tree); | |
607 | void print_value_expressions (FILE *, tree); | |
608 | ||
6de9cd9a DN |
609 | #include "tree-flow-inline.h" |
610 | ||
611 | #endif /* _TREE_FLOW_H */ |