* tree-outof-ssa.c (_elim_graph): Change the type of edge_list
[official-gcc.git] / gcc / tree-flow.h
blobfda3e576892cbdf38621c96973dd848921ecc08b
1 /* Data and Control Flow Analysis for Trees.
2 Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
3 Contributed by Diego Novillo <dnovillo@redhat.com>
5 This file is part of GCC.
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.
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.
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. */
22 #ifndef _TREE_FLOW_H
23 #define _TREE_FLOW_H 1
25 #include "bitmap.h"
26 #include "hard-reg-set.h"
27 #include "basic-block.h"
28 #include "hashtab.h"
29 #include "tree-gimple.h"
30 #include "tree-ssa-operands.h"
31 #include "cgraph.h"
33 /* Forward declare structures for the garbage collector GTY markers. */
34 #ifndef GCC_BASIC_BLOCK_H
35 struct edge_def;
36 typedef struct edge_def *edge;
37 struct basic_block_def;
38 typedef struct basic_block_def *basic_block;
39 #endif
41 /* True if the code is in ssa form. */
42 extern bool in_ssa_p;
44 /*---------------------------------------------------------------------------
45 Attributes for SSA_NAMEs.
47 NOTE: These structures are stored in struct tree_ssa_name
48 but are only used by the tree optimizers, so it makes better sense
49 to declare them here to avoid recompiling unrelated files when
50 making changes.
51 ---------------------------------------------------------------------------*/
53 /* Aliasing information for SSA_NAMEs representing pointer variables. */
54 struct ptr_info_def GTY(())
56 /* Nonzero if points-to analysis couldn't determine where this pointer
57 is pointing to. */
58 unsigned int pt_anything : 1;
60 /* Nonzero if this pointer is the result of a call to malloc. */
61 unsigned int pt_malloc : 1;
63 /* Nonzero if the value of this pointer escapes the current function. */
64 unsigned int value_escapes_p : 1;
66 /* Nonzero if this pointer is dereferenced. */
67 unsigned int is_dereferenced : 1;
69 /* Nonzero if this pointer points to a global variable. */
70 unsigned int pt_global_mem : 1;
72 /* Nonzero if this pointer points to NULL. */
73 unsigned int pt_null : 1;
75 /* Set of variables that this pointer may point to. */
76 bitmap pt_vars;
78 /* If this pointer has been dereferenced, and points-to information is
79 more precise than type-based aliasing, indirect references to this
80 pointer will be represented by this memory tag, instead of the type
81 tag computed by TBAA. */
82 tree name_mem_tag;
86 /* Types of value ranges. */
87 enum value_range_type { VR_UNDEFINED, VR_RANGE, VR_ANTI_RANGE, VR_VARYING };
90 /* Ranges of values that can be associated with an SSA_NAME after VRP
91 has executed. */
92 struct value_range_def GTY(())
94 /* Lattice value represented by this range. */
95 enum value_range_type type;
97 /* Minimum and maximum values represented by this range. These
98 values are _CST nodes that should be interpreted as follows:
100 - If TYPE == VR_UNDEFINED then MIN and MAX must be NULL.
102 - If TYPE == VR_RANGE then MIN holds the minimum value and
103 MAX holds the maximum value of the range [MIN, MAX].
105 - If TYPE == ANTI_RANGE the variable is known to NOT
106 take any values in the range [MIN, MAX]. */
107 tree min;
108 tree max;
111 typedef struct value_range_def value_range;
114 /*---------------------------------------------------------------------------
115 Tree annotations stored in tree_common.ann
116 ---------------------------------------------------------------------------*/
117 enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, STMT_ANN };
119 struct tree_ann_common_d GTY(())
121 /* Annotation type. */
122 enum tree_ann_type type;
124 /* The value handle for this expression. Used by GVN-PRE. */
125 tree GTY((skip)) value_handle;
128 /* It is advantageous to avoid things like life analysis for variables which
129 do not need PHI nodes. This enum describes whether or not a particular
130 variable may need a PHI node. */
132 enum need_phi_state {
133 /* This is the default. If we are still in this state after finding
134 all the definition and use sites, then we will assume the variable
135 needs PHI nodes. This is probably an overly conservative assumption. */
136 NEED_PHI_STATE_UNKNOWN,
138 /* This state indicates that we have seen one or more sets of the
139 variable in a single basic block and that the sets dominate all
140 uses seen so far. If after finding all definition and use sites
141 we are still in this state, then the variable does not need any
142 PHI nodes. */
143 NEED_PHI_STATE_NO,
145 /* This state indicates that we have either seen multiple definitions of
146 the variable in multiple blocks, or that we encountered a use in a
147 block that was not dominated by the block containing the set(s) of
148 this variable. This variable is assumed to need PHI nodes. */
149 NEED_PHI_STATE_MAYBE
153 /* When computing aliasing information, we represent the memory pointed-to
154 by pointers with artificial variables called "memory tags" (MT). There
155 are two kinds of tags: type and name. Type tags (TMT) are used in
156 type-based alias analysis, they represent all the pointed-to locations
157 and variables of the same alias set class. Name tags (NMT) are used in
158 flow-sensitive points-to alias analysis, they represent the variables
159 and memory locations pointed-to by a specific SSA_NAME pointer. */
160 enum mem_tag_kind {
161 /* This variable is not a memory tag. */
162 NOT_A_TAG,
164 /* This variable is a type memory tag (TMT). */
165 TYPE_TAG,
167 /* This variable is a name memory tag (NMT). */
168 NAME_TAG,
170 /* This variable represents a structure field. */
171 STRUCT_FIELD
173 struct subvar;
174 typedef struct subvar *subvar_t;
176 /* This structure represents a fake sub-variable for a structure field. */
178 struct subvar GTY(())
180 /* Fake variable name */
181 tree var;
182 /* Offset inside structure. */
183 HOST_WIDE_INT offset;
184 /* Size of field. */
185 HOST_WIDE_INT size;
186 /* Next subvar for this structure. */
187 subvar_t next;
190 struct var_ann_d GTY(())
192 struct tree_ann_common_d common;
194 /* Used by the out of SSA pass to determine whether this variable has
195 been seen yet or not. */
196 unsigned out_of_ssa_tag : 1;
198 /* Used when building root_var structures in tree_ssa_live.[ch]. */
199 unsigned root_var_processed : 1;
201 /* If nonzero, this variable is a memory tag. */
202 ENUM_BITFIELD (mem_tag_kind) mem_tag_kind : 2;
204 /* Nonzero if this variable is an alias tag that represents references to
205 other variables (i.e., this variable appears in the MAY_ALIASES array
206 of other variables). */
207 unsigned is_alias_tag : 1;
209 /* Nonzero if this variable was used after SSA optimizations were
210 applied. We set this when translating out of SSA form. */
211 unsigned used : 1;
213 /* This field indicates whether or not the variable may need PHI nodes.
214 See the enum's definition for more detailed information about the
215 states. */
216 ENUM_BITFIELD (need_phi_state) need_phi_state : 2;
218 /* Used during operand processing to determine if this variable is already
219 in the vuse list. */
220 unsigned in_vuse_list : 1;
222 /* Used during operand processing to determine if this variable is already
223 in the v_may_def list. */
224 unsigned in_v_may_def_list : 1;
226 /* An artificial variable representing the memory location pointed-to by
227 all the pointers that TBAA (type-based alias analysis) considers
228 to be aliased. If the variable is not a pointer or if it is never
229 dereferenced, this must be NULL. */
230 tree type_mem_tag;
232 /* Variables that may alias this variable. */
233 varray_type may_aliases;
235 /* Unique ID of this variable. */
236 size_t uid;
238 /* Used when going out of SSA form to indicate which partition this
239 variable represents storage for. */
240 unsigned partition;
242 /* Used by the root-var object in tree-ssa-live.[ch]. */
243 unsigned root_index;
245 /* Default definition for this symbol. If this field is not NULL, it
246 means that the first reference to this variable in the function is a
247 USE or a VUSE. In those cases, the SSA renamer creates an SSA name
248 for this variable with an empty defining statement. */
249 tree default_def;
251 /* During into-ssa and the dominator optimizer, this field holds the
252 current version of this variable (an SSA_NAME). */
253 tree current_def;
255 /* If this variable is a structure, this fields holds a list of
256 symbols representing each of the fields of the structure. */
257 subvar_t subvars;
261 typedef struct immediate_use_iterator_d
263 ssa_use_operand_t *imm_use;
264 ssa_use_operand_t *end_p;
265 ssa_use_operand_t iter_node;
266 } imm_use_iterator;
269 /* Use this iterator when simply looking at stmts. Adding, deleting or
270 modifying stmts will cause this iterator to malfunction. */
272 #define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
273 for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \
274 !end_readonly_imm_use_p (&(ITER)); \
275 (DEST) = next_readonly_imm_use (&(ITER)))
278 #define FOR_EACH_IMM_USE_SAFE(DEST, ITER, SSAVAR) \
279 for ((DEST) = first_safe_imm_use (&(ITER), (SSAVAR)); \
280 !end_safe_imm_use_p (&(ITER)); \
281 (DEST) = next_safe_imm_use (&(ITER)))
283 #define BREAK_FROM_SAFE_IMM_USE(ITER) \
285 end_safe_imm_use_traverse (&(ITER)); \
286 break; \
289 struct stmt_ann_d GTY(())
291 struct tree_ann_common_d common;
293 /* Nonzero if the statement has been modified (meaning that the operands
294 need to be scanned again). */
295 unsigned modified : 1;
297 /* Nonzero if the statement makes aliased loads. */
298 unsigned makes_aliased_loads : 1;
300 /* Nonzero if the statement makes aliased stores. */
301 unsigned makes_aliased_stores : 1;
303 /* Nonzero if the statement makes references to volatile storage. */
304 unsigned has_volatile_ops : 1;
306 /* Nonzero if the statement makes a function call that may clobber global
307 and local addressable variables. */
308 unsigned makes_clobbering_call : 1;
310 /* Basic block that contains this statement. */
311 basic_block bb;
313 /* Operand cache for stmt. */
314 struct stmt_operands_d GTY ((skip (""))) operands;
316 /* Set of variables that have had their address taken in the statement. */
317 bitmap addresses_taken;
319 /* Unique identifier for this statement. These ID's are to be created
320 by each pass on an as-needed basis in any order convenient for the
321 pass which needs statement UIDs. */
322 unsigned int uid;
324 /* Auxiliary info specific to a pass. At all times, this
325 should either point to valid data or be NULL. */
326 PTR GTY ((skip (""))) aux;
328 /* Linked list of histograms for value-based profiling. This is really a
329 struct histogram_value*. We use void* to avoid having to export that
330 everywhere, and to avoid having to put it in GC memory. */
332 void * GTY ((skip (""))) histograms;
335 union tree_ann_d GTY((desc ("ann_type ((tree_ann_t)&%h)")))
337 struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
338 struct var_ann_d GTY((tag ("VAR_ANN"))) decl;
339 struct stmt_ann_d GTY((tag ("STMT_ANN"))) stmt;
342 extern GTY(()) VEC(tree,gc) *modified_noreturn_calls;
344 typedef union tree_ann_d *tree_ann_t;
345 typedef struct var_ann_d *var_ann_t;
346 typedef struct stmt_ann_d *stmt_ann_t;
348 static inline tree_ann_t tree_ann (tree);
349 static inline tree_ann_t get_tree_ann (tree);
350 static inline var_ann_t var_ann (tree);
351 static inline var_ann_t get_var_ann (tree);
352 static inline stmt_ann_t stmt_ann (tree);
353 static inline stmt_ann_t get_stmt_ann (tree);
354 static inline enum tree_ann_type ann_type (tree_ann_t);
355 static inline basic_block bb_for_stmt (tree);
356 extern void set_bb_for_stmt (tree, basic_block);
357 static inline bool noreturn_call_p (tree);
358 static inline void update_stmt (tree);
359 static inline bool stmt_modified_p (tree);
360 static inline varray_type may_aliases (tree);
361 static inline int get_lineno (tree);
362 static inline const char *get_filename (tree);
363 static inline bool is_exec_stmt (tree);
364 static inline bool is_label_stmt (tree);
365 static inline bitmap addresses_taken (tree);
366 static inline void set_default_def (tree, tree);
367 static inline tree default_def (tree);
369 /*---------------------------------------------------------------------------
370 Structure representing predictions in tree level.
371 ---------------------------------------------------------------------------*/
372 struct edge_prediction GTY((chain_next ("%h.next")))
374 struct edge_prediction *next;
375 edge edge;
376 enum br_predictor predictor;
377 int probability;
380 /* Accessors for basic block annotations. */
381 static inline tree phi_nodes (basic_block);
382 static inline void set_phi_nodes (basic_block, tree);
384 /*---------------------------------------------------------------------------
385 Global declarations
386 ---------------------------------------------------------------------------*/
387 /* Array of all variables referenced in the function. */
388 extern GTY(()) VEC(tree,gc) *referenced_vars;
390 #define num_referenced_vars VEC_length (tree, referenced_vars)
391 #define referenced_var(i) VEC_index (tree, referenced_vars, i)
393 /* Array of all SSA_NAMEs used in the function. */
394 extern GTY(()) VEC(tree,gc) *ssa_names;
396 #define num_ssa_names (VEC_length (tree, ssa_names))
397 #define ssa_name(i) (VEC_index (tree, ssa_names, (i)))
399 /* Artificial variable used to model the effects of function calls. */
400 extern GTY(()) tree global_var;
402 /* Call clobbered variables in the function. If bit I is set, then
403 REFERENCED_VARS (I) is call-clobbered. */
404 extern bitmap call_clobbered_vars;
406 /* Addressable variables in the function. If bit I is set, then
407 REFERENCED_VARS (I) has had its address taken. */
408 extern bitmap addressable_vars;
410 /* 'true' after aliases have been computed (see compute_may_aliases). */
411 extern bool aliases_computed_p;
413 /* Macros for showing usage statistics. */
414 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
415 ? (x) \
416 : ((x) < 1024*1024*10 \
417 ? (x) / 1024 \
418 : (x) / (1024*1024))))
420 #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
422 #define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
424 /*---------------------------------------------------------------------------
425 Block iterators
426 ---------------------------------------------------------------------------*/
428 typedef struct {
429 tree_stmt_iterator tsi;
430 basic_block bb;
431 } block_stmt_iterator;
433 static inline block_stmt_iterator bsi_start (basic_block);
434 static inline block_stmt_iterator bsi_last (basic_block);
435 static inline block_stmt_iterator bsi_after_labels (basic_block);
436 block_stmt_iterator bsi_for_stmt (tree);
437 static inline bool bsi_end_p (block_stmt_iterator);
438 static inline void bsi_next (block_stmt_iterator *);
439 static inline void bsi_prev (block_stmt_iterator *);
440 static inline tree bsi_stmt (block_stmt_iterator);
441 static inline tree * bsi_stmt_ptr (block_stmt_iterator);
443 extern void bsi_remove (block_stmt_iterator *);
444 extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *);
445 extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *);
446 extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block);
448 enum bsi_iterator_update
450 /* Note that these are intentionally in the same order as TSI_FOO. They
451 mean exactly the same as their TSI_* counterparts. */
452 BSI_NEW_STMT,
453 BSI_SAME_STMT,
454 BSI_CHAIN_START,
455 BSI_CHAIN_END,
456 BSI_CONTINUE_LINKING
459 extern void bsi_insert_before (block_stmt_iterator *, tree,
460 enum bsi_iterator_update);
461 extern void bsi_insert_after (block_stmt_iterator *, tree,
462 enum bsi_iterator_update);
464 extern void bsi_replace (const block_stmt_iterator *, tree, bool);
466 /*---------------------------------------------------------------------------
467 Function prototypes
468 ---------------------------------------------------------------------------*/
469 /* In tree-cfg.c */
471 /* Location to track pending stmt for edge insertion. */
472 #define PENDING_STMT(e) ((e)->insns.t)
474 extern void delete_tree_cfg_annotations (void);
475 extern void disband_implicit_edges (void);
476 extern bool stmt_ends_bb_p (tree);
477 extern bool is_ctrl_stmt (tree);
478 extern bool is_ctrl_altering_stmt (tree);
479 extern bool computed_goto_p (tree);
480 extern bool simple_goto_p (tree);
481 extern void tree_dump_bb (basic_block, FILE *, int);
482 extern void debug_tree_bb (basic_block);
483 extern basic_block debug_tree_bb_n (int);
484 extern void dump_tree_cfg (FILE *, int);
485 extern void debug_tree_cfg (int);
486 extern void dump_cfg_stats (FILE *);
487 extern void debug_cfg_stats (void);
488 extern void debug_loop_ir (void);
489 extern void print_loop_ir (FILE *);
490 extern void cleanup_dead_labels (void);
491 extern void group_case_labels (void);
492 extern tree first_stmt (basic_block);
493 extern tree last_stmt (basic_block);
494 extern tree *last_stmt_ptr (basic_block);
495 extern tree last_and_only_stmt (basic_block);
496 extern edge find_taken_edge (basic_block, tree);
497 extern basic_block label_to_block_fn (struct function *, tree);
498 #define label_to_block(t) (label_to_block_fn (cfun, t))
499 extern void bsi_insert_on_edge (edge, tree);
500 extern basic_block bsi_insert_on_edge_immediate (edge, tree);
501 extern void bsi_commit_one_edge_insert (edge, basic_block *);
502 extern void bsi_commit_edge_inserts (void);
503 extern void notice_special_calls (tree);
504 extern void clear_special_calls (void);
505 extern void verify_stmts (void);
506 extern tree tree_block_label (basic_block);
507 extern void extract_true_false_edges_from_block (basic_block, edge *, edge *);
508 extern bool tree_duplicate_sese_region (edge, edge, basic_block *, unsigned,
509 basic_block *);
510 extern void add_phi_args_after_copy_bb (basic_block);
511 extern void add_phi_args_after_copy (basic_block *, unsigned);
512 extern bool tree_purge_dead_eh_edges (basic_block);
513 extern bool tree_purge_all_dead_eh_edges (bitmap);
514 extern tree gimplify_val (block_stmt_iterator *, tree, tree);
515 extern tree gimplify_build1 (block_stmt_iterator *, enum tree_code,
516 tree, tree);
517 extern tree gimplify_build2 (block_stmt_iterator *, enum tree_code,
518 tree, tree, tree);
519 extern tree gimplify_build3 (block_stmt_iterator *, enum tree_code,
520 tree, tree, tree, tree);
521 extern void init_empty_tree_cfg (void);
522 extern void fold_cond_expr_cond (void);
523 extern void replace_uses_by (tree, tree);
524 extern void start_recording_case_labels (void);
525 extern void end_recording_case_labels (void);
527 /* In tree-cfgcleanup.c */
528 extern bool cleanup_tree_cfg (void);
529 extern void cleanup_tree_cfg_loop (void);
531 /* In tree-pretty-print.c. */
532 extern void dump_generic_bb (FILE *, basic_block, int, int);
534 /* In tree-dfa.c */
535 extern var_ann_t create_var_ann (tree);
536 extern stmt_ann_t create_stmt_ann (tree);
537 extern tree_ann_t create_tree_ann (tree);
538 extern void reserve_phi_args_for_new_edge (basic_block);
539 extern tree create_phi_node (tree, basic_block);
540 extern void add_phi_arg (tree, tree, edge);
541 extern void remove_phi_args (edge);
542 extern void remove_phi_node (tree, tree);
543 extern tree phi_reverse (tree);
544 extern void dump_dfa_stats (FILE *);
545 extern void debug_dfa_stats (void);
546 extern void debug_referenced_vars (void);
547 extern void dump_referenced_vars (FILE *);
548 extern void dump_variable (FILE *, tree);
549 extern void debug_variable (tree);
550 extern tree get_virtual_var (tree);
551 extern void add_referenced_tmp_var (tree);
552 extern void mark_new_vars_to_rename (tree);
553 extern void find_new_referenced_vars (tree *);
555 extern tree make_rename_temp (tree, const char *);
557 /* In gimple-low.c */
558 extern void record_vars (tree);
559 extern bool block_may_fallthru (tree block);
561 /* In tree-ssa-alias.c */
562 extern void dump_may_aliases_for (FILE *, tree);
563 extern void debug_may_aliases_for (tree);
564 extern void dump_alias_info (FILE *);
565 extern void debug_alias_info (void);
566 extern void dump_points_to_info (FILE *);
567 extern void debug_points_to_info (void);
568 extern void dump_points_to_info_for (FILE *, tree);
569 extern void debug_points_to_info_for (tree);
570 extern bool may_be_aliased (tree);
571 extern struct ptr_info_def *get_ptr_info (tree);
572 extern void add_type_alias (tree, tree);
573 extern void new_type_alias (tree, tree);
574 extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *, bool *);
575 static inline subvar_t get_subvars_for_var (tree);
576 static inline bool ref_contains_array_ref (tree);
577 extern tree okay_component_ref_for_subvars (tree, HOST_WIDE_INT *,
578 HOST_WIDE_INT *);
579 static inline bool var_can_have_subvars (tree);
580 static inline bool overlap_subvar (HOST_WIDE_INT, HOST_WIDE_INT,
581 subvar_t, bool *);
583 /* Call-back function for walk_use_def_chains(). At each reaching
584 definition, a function with this prototype is called. */
585 typedef bool (*walk_use_def_chains_fn) (tree, tree, void *);
588 /* In tree-ssa.c */
589 extern void init_tree_ssa (void);
590 extern edge ssa_redirect_edge (edge, basic_block);
591 extern void flush_pending_stmts (edge);
592 extern bool tree_ssa_useless_type_conversion (tree);
593 extern bool tree_ssa_useless_type_conversion_1 (tree, tree);
594 extern void verify_ssa (bool);
595 extern void delete_tree_ssa (void);
596 extern void register_new_def (tree, VEC(tree,heap) **);
597 extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
598 extern bool stmt_references_memory_p (tree);
600 /* In tree-into-ssa.c */
601 void update_ssa (unsigned);
602 void delete_update_ssa (void);
603 void register_new_name_mapping (tree, tree);
604 tree create_new_def_for (tree, tree, def_operand_p);
605 bool need_ssa_update_p (void);
606 bool name_registered_for_update_p (tree);
607 bitmap ssa_names_to_replace (void);
608 void release_ssa_name_after_update_ssa (tree name);
609 void compute_global_livein (bitmap, bitmap);
610 tree duplicate_ssa_name (tree, tree);
611 void mark_sym_for_renaming (tree);
612 void mark_set_for_renaming (bitmap);
613 tree get_current_def (tree);
614 void set_current_def (tree, tree);
616 /* In tree-ssa-ccp.c */
617 bool fold_stmt (tree *);
618 bool fold_stmt_inplace (tree);
619 tree widen_bitfield (tree, tree, tree);
621 /* In tree-vrp.c */
622 value_range *get_value_range (tree);
623 void dump_value_range (FILE *, value_range *);
624 void debug_value_range (value_range *);
625 void dump_all_value_ranges (FILE *);
626 void debug_all_value_ranges (void);
627 bool expr_computes_nonzero (tree);
629 /* In tree-ssa-dom.c */
630 extern void dump_dominator_optimization_stats (FILE *);
631 extern void debug_dominator_optimization_stats (void);
632 int loop_depth_of_name (tree);
634 /* In tree-ssa-copy.c */
635 extern void propagate_value (use_operand_p, tree);
636 extern void propagate_tree_value (tree *, tree);
637 extern void replace_exp (use_operand_p, tree);
638 extern bool may_propagate_copy (tree, tree);
639 extern bool may_propagate_copy_into_asm (tree);
641 /* Description of number of iterations of a loop. All the expressions inside
642 the structure can be evaluated at the end of the loop's preheader
643 (and due to ssa form, also anywhere inside the body of the loop). */
645 struct tree_niter_desc
647 tree assumptions; /* The boolean expression. If this expression evaluates
648 to false, then the other fields in this structure
649 should not be used; there is no guarantee that they
650 will be correct. */
651 tree may_be_zero; /* The boolean expression. If it evaluates to true,
652 the loop will exit in the first iteration (i.e.
653 its latch will not be executed), even if the niter
654 field says otherwise. */
655 tree niter; /* The expression giving the number of iterations of
656 a loop (provided that assumptions == true and
657 may_be_zero == false), more precisely the number
658 of executions of the latch of the loop. */
659 tree additional_info; /* The boolean expression. Sometimes we use additional
660 knowledge to simplify the other expressions
661 contained in this structure (for example the
662 knowledge about value ranges of operands on entry to
663 the loop). If this is a case, conjunction of such
664 condition is stored in this field, so that we do not
665 lose the information: for example if may_be_zero
666 is (n <= 0) and niter is (unsigned) n, we know
667 that the number of iterations is at most
668 MAX_SIGNED_INT. However if the (n <= 0) assumption
669 is eliminated (by looking at the guard on entry of
670 the loop), then the information would be lost. */
673 /* In tree-vectorizer.c */
674 void vectorize_loops (struct loops *);
676 /* In tree-ssa-phiopt.c */
677 bool empty_block_p (basic_block);
679 /* In tree-ssa-loop*.c */
681 void tree_ssa_lim (struct loops *);
682 void tree_ssa_unswitch_loops (struct loops *);
683 void canonicalize_induction_variables (struct loops *);
684 void tree_unroll_loops_completely (struct loops *, bool);
685 void tree_ssa_iv_optimize (struct loops *);
687 bool number_of_iterations_exit (struct loop *, edge,
688 struct tree_niter_desc *niter);
689 tree find_loop_niter (struct loop *, edge *);
690 tree loop_niter_by_eval (struct loop *, edge);
691 tree find_loop_niter_by_eval (struct loop *, edge *);
692 void estimate_numbers_of_iterations (struct loops *);
693 tree can_count_iv_in_wider_type (struct loop *, tree, tree, tree, tree);
694 void free_numbers_of_iterations_estimates (struct loops *);
695 void rewrite_into_loop_closed_ssa (bitmap, unsigned);
696 void verify_loop_closed_ssa (void);
697 void loop_commit_inserts (void);
698 bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
699 void create_iv (tree, tree, tree, struct loop *, block_stmt_iterator *, bool,
700 tree *, tree *);
701 void split_loop_exit_edge (edge);
702 basic_block bsi_insert_on_edge_immediate_loop (edge, tree);
703 void standard_iv_increment_position (struct loop *, block_stmt_iterator *,
704 bool *);
705 basic_block ip_end_pos (struct loop *);
706 basic_block ip_normal_pos (struct loop *);
707 bool tree_duplicate_loop_to_header_edge (struct loop *, edge, struct loops *,
708 unsigned int, sbitmap,
709 edge, edge *,
710 unsigned int *, int);
711 struct loop *tree_ssa_loop_version (struct loops *, struct loop *, tree,
712 basic_block *);
713 tree expand_simple_operations (tree);
715 /* In tree-ssa-loop-im.c */
716 /* The possibilities of statement movement. */
718 enum move_pos
720 MOVE_IMPOSSIBLE, /* No movement -- side effect expression. */
721 MOVE_PRESERVE_EXECUTION, /* Must not cause the non-executed statement
722 become executed -- memory accesses, ... */
723 MOVE_POSSIBLE /* Unlimited movement. */
725 extern enum move_pos movement_possibility (tree);
727 /* In tree-flow-inline.h */
728 static inline bool is_call_clobbered (tree);
729 static inline void mark_call_clobbered (tree);
730 static inline void set_is_used (tree);
731 static inline bool unmodifiable_var_p (tree);
733 /* In tree-eh.c */
734 extern void make_eh_edges (tree);
735 extern bool tree_could_trap_p (tree);
736 extern bool tree_could_throw_p (tree);
737 extern bool tree_can_throw_internal (tree);
738 extern bool tree_can_throw_external (tree);
739 extern int lookup_stmt_eh_region (tree);
740 extern void add_stmt_to_eh_region (tree, int);
741 extern bool remove_stmt_from_eh_region (tree);
742 extern bool maybe_clean_or_replace_eh_stmt (tree, tree);
744 /* In tree-ssa-pre.c */
745 void add_to_value (tree, tree);
746 void debug_value_expressions (tree);
747 void print_value_expressions (FILE *, tree);
750 /* In tree-vn.c */
751 bool expressions_equal_p (tree, tree);
752 tree get_value_handle (tree);
753 hashval_t vn_compute (tree, hashval_t, tree);
754 tree vn_lookup_or_add (tree, tree);
755 void vn_add (tree, tree, tree);
756 tree vn_lookup (tree, tree);
757 void vn_init (void);
758 void vn_delete (void);
760 /* In tree-ssa-sink.c */
761 bool is_hidden_global_store (tree);
763 /* In tree-sra.c */
764 void insert_edge_copies (tree, basic_block);
766 /* In tree-loop-linear.c */
767 extern void linear_transform_loops (struct loops *);
769 /* In tree-ssa-loop-ivopts.c */
770 extern bool expr_invariant_in_loop_p (struct loop *, tree);
772 /* In tree-ssa-threadupdate.c. */
773 extern bool thread_through_all_blocks (bitmap);
775 /* In gimplify.c */
776 tree force_gimple_operand (tree, tree *, bool, tree);
777 tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree);
779 #include "tree-flow-inline.h"
781 #endif /* _TREE_FLOW_H */