* Merge with edge-vector-mergepoint-20040918.
[official-gcc.git] / gcc / tree-flow.h
blobbdcd4aa6879da2f3d13a635a1cc0b1c0bf3c012c
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>
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 /*---------------------------------------------------------------------------
42 Attributes for SSA_NAMEs.
44 NOTE: These structures are stored in struct tree_ssa_name
45 but are only used by the tree optimizers, so it makes better sense
46 to declare them here to avoid recompiling unrelated files when
47 making changes.
48 ---------------------------------------------------------------------------*/
50 /* Aliasing information for SSA_NAMEs representing pointer variables. */
51 struct ptr_info_def GTY(())
53 /* Nonzero if points-to analysis couldn't determine where this pointer
54 is pointing to. */
55 unsigned int pt_anything : 1;
57 /* Nonzero if this pointer is the result of a call to malloc. */
58 unsigned int pt_malloc : 1;
60 /* Nonzero if the value of this pointer escapes the current function. */
61 unsigned int value_escapes_p : 1;
63 /* Nonzero if this pointer is dereferenced. */
64 unsigned int is_dereferenced : 1;
66 /* Nonzero if this pointer points to a global variable. */
67 unsigned int pt_global_mem : 1;
69 /* Set of variables that this pointer may point to. */
70 bitmap pt_vars;
72 /* If this pointer has been dereferenced, and points-to information is
73 more precise than type-based aliasing, indirect references to this
74 pointer will be represented by this memory tag, instead of the type
75 tag computed by TBAA. */
76 tree name_mem_tag;
80 /*---------------------------------------------------------------------------
81 Tree annotations stored in tree_common.ann
82 ---------------------------------------------------------------------------*/
83 enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, STMT_ANN };
85 struct tree_ann_common_d GTY(())
87 /* Annotation type. */
88 enum tree_ann_type type;
90 /* Auxiliary info specific to a pass. At all times, this
91 should either point to valid data or be NULL. */
92 PTR GTY ((skip (""))) aux;
94 /* The value handle for this expression. Used by GVN-PRE. */
95 tree GTY((skip)) value_handle;
98 /* It is advantageous to avoid things like life analysis for variables which
99 do not need PHI nodes. This enum describes whether or not a particular
100 variable may need a PHI node. */
102 enum need_phi_state {
103 /* This is the default. If we are still in this state after finding
104 all the definition and use sites, then we will assume the variable
105 needs PHI nodes. This is probably an overly conservative assumption. */
106 NEED_PHI_STATE_UNKNOWN,
108 /* This state indicates that we have seen one or more sets of the
109 variable in a single basic block and that the sets dominate all
110 uses seen so far. If after finding all definition and use sites
111 we are still in this state, then the variable does not need any
112 PHI nodes. */
113 NEED_PHI_STATE_NO,
115 /* This state indicates that we have either seen multiple definitions of
116 the variable in multiple blocks, or that we encountered a use in a
117 block that was not dominated by the block containing the set(s) of
118 this variable. This variable is assumed to need PHI nodes. */
119 NEED_PHI_STATE_MAYBE
123 /* When computing aliasing information, we represent the memory pointed-to
124 by pointers with artificial variables called "memory tags" (MT). There
125 are two kinds of tags: type and name. Type tags (TMT) are used in
126 type-based alias analysis, they represent all the pointed-to locations
127 and variables of the same alias set class. Name tags (NMT) are used in
128 flow-sensitive points-to alias analysis, they represent the variables
129 and memory locations pointed-to by a specific SSA_NAME pointer. */
130 enum mem_tag_kind {
131 /* This variable is not a memory tag. */
132 NOT_A_TAG,
134 /* This variable is a type memory tag (TMT). */
135 TYPE_TAG,
137 /* This variable is a name memory tag (NMT). */
138 NAME_TAG
141 struct var_ann_d GTY(())
143 struct tree_ann_common_d common;
145 /* Used by the out of SSA pass to determine whether this variable has
146 been seen yet or not. */
147 unsigned out_of_ssa_tag : 1;
149 /* Used when building root_var structures in tree_ssa_live.[ch]. */
150 unsigned root_var_processed : 1;
152 /* If nonzero, this variable is a memory tag. */
153 ENUM_BITFIELD (mem_tag_kind) mem_tag_kind : 2;
155 /* Nonzero if this variable is an alias tag that represents references to
156 other variables (i.e., this variable appears in the MAY_ALIASES array
157 of other variables). */
158 unsigned is_alias_tag : 1;
160 /* Nonzero if this variable was used after SSA optimizations were
161 applied. We set this when translating out of SSA form. */
162 unsigned used : 1;
164 /* This field indicates whether or not the variable may need PHI nodes.
165 See the enum's definition for more detailed information about the
166 states. */
167 ENUM_BITFIELD (need_phi_state) need_phi_state : 2;
169 /* An artificial variable representing the memory location pointed-to by
170 all the pointers that TBAA (type-based alias analysis) considers
171 to be aliased. If the variable is not a pointer or if it is never
172 dereferenced, this must be NULL. */
173 tree type_mem_tag;
175 /* Variables that may alias this variable. */
176 varray_type may_aliases;
178 /* Unique ID of this variable. */
179 size_t uid;
181 /* Used when going out of SSA form to indicate which partition this
182 variable represents storage for. */
183 unsigned partition;
185 /* Used by the root-var object in tree-ssa-live.[ch]. */
186 unsigned root_index;
188 /* Default definition for this symbol. If this field is not NULL, it
189 means that the first reference to this variable in the function is a
190 USE or a VUSE. In those cases, the SSA renamer creates an SSA name
191 for this variable with an empty defining statement. */
192 tree default_def;
194 /* During into-ssa and the dominator optimizer, this field holds the
195 current version of this variable (an SSA_NAME).
197 This was previously two varrays (one in into-ssa the other in the
198 dominator optimizer). That is wasteful, particularly since the
199 dominator optimizer calls into-ssa resulting in having two varrays
200 live at the same time and this can happen for each call to the
201 dominator optimizer. */
202 tree current_def;
204 /* Pointer to the structure that contains the sets of global
205 variables modified by function calls. This field is only used
206 for FUNCTION_DECLs. */
207 static_vars_info_t static_vars_info;
211 struct dataflow_d GTY(())
213 /* Immediate uses. This is a list of all the statements and PHI nodes
214 that are immediately reached by the definitions made in this
215 statement. */
216 varray_type immediate_uses;
218 /* Use this array for very small numbers of uses instead of the varray. */
219 tree uses[2];
221 /* Reached uses. This is a list of all the possible program statements
222 that may be reached directly or indirectly by definitions made in this
223 statement. Notice that this is a superset of IMMEDIATE_USES.
224 For instance, given the following piece of code:
226 1 a1 = 10;
227 2 if (a1 > 3)
228 3 a2 = a1 + 5;
229 4 a3 = PHI (a1, a2)
230 5 b1 = a3 - 2;
232 IMMEDIATE_USES for statement #1 are all those statements that use a1
233 directly (i.e., #2, #3 and #4). REACHED_USES for statement #1 also
234 includes statement #5 because 'a1' could reach 'a3' via the PHI node
235 at statement #4. The set of REACHED_USES is then the transitive
236 closure over all the PHI nodes in the IMMEDIATE_USES set. */
238 /* Reaching definitions. Similarly to REACHED_USES, the set
239 REACHING_DEFS is the set of all the statements that make definitions
240 that may reach this statement. Notice that we don't need to have a
241 similar entry for immediate definitions, as these are represented by
242 the SSA_NAME nodes themselves (each SSA_NAME node contains a pointer
243 to the statement that makes that definition). */
246 typedef struct dataflow_d *dataflow_t;
249 struct stmt_ann_d GTY(())
251 struct tree_ann_common_d common;
253 /* Nonzero if the statement has been modified (meaning that the operands
254 need to be scanned again). */
255 unsigned modified : 1;
257 /* Nonzero if the statement makes aliased loads. */
258 unsigned makes_aliased_loads : 1;
260 /* Nonzero if the statement makes aliased stores. */
261 unsigned makes_aliased_stores : 1;
263 /* Nonzero if the statement makes references to volatile storage. */
264 unsigned has_volatile_ops : 1;
266 /* Nonzero if the statement makes a function call that may clobber global
267 and local addressable variables. */
268 unsigned makes_clobbering_call : 1;
270 /* Basic block that contains this statement. */
271 basic_block GTY ((skip (""))) bb;
273 struct stmt_operands_d operands;
275 /* Dataflow information. */
276 dataflow_t df;
278 /* Set of variables that have had their address taken in the statement. */
279 bitmap addresses_taken;
281 /* Unique identifier for this statement. These ID's are to be created
282 by each pass on an as-needed basis in any order convenient for the
283 pass which needs statement UIDs. */
284 unsigned int uid;
287 union tree_ann_d GTY((desc ("ann_type ((tree_ann_t)&%h)")))
289 struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
290 struct var_ann_d GTY((tag ("VAR_ANN"))) decl;
291 struct stmt_ann_d GTY((tag ("STMT_ANN"))) stmt;
294 typedef union tree_ann_d *tree_ann_t;
295 typedef struct var_ann_d *var_ann_t;
296 typedef struct stmt_ann_d *stmt_ann_t;
298 static inline tree_ann_t tree_ann (tree);
299 static inline tree_ann_t get_tree_ann (tree);
300 static inline var_ann_t var_ann (tree);
301 static inline var_ann_t get_var_ann (tree);
302 static inline stmt_ann_t stmt_ann (tree);
303 static inline stmt_ann_t get_stmt_ann (tree);
304 static inline enum tree_ann_type ann_type (tree_ann_t);
305 static inline basic_block bb_for_stmt (tree);
306 extern void set_bb_for_stmt (tree, basic_block);
307 static inline void modify_stmt (tree);
308 static inline void unmodify_stmt (tree);
309 static inline bool stmt_modified_p (tree);
310 static inline varray_type may_aliases (tree);
311 static inline int get_lineno (tree);
312 static inline const char *get_filename (tree);
313 static inline bool is_exec_stmt (tree);
314 static inline bool is_label_stmt (tree);
315 static inline v_may_def_optype get_v_may_def_ops (stmt_ann_t);
316 static inline vuse_optype get_vuse_ops (stmt_ann_t);
317 static inline use_optype get_use_ops (stmt_ann_t);
318 static inline def_optype get_def_ops (stmt_ann_t);
319 static inline bitmap addresses_taken (tree);
320 static inline int num_immediate_uses (dataflow_t);
321 static inline tree immediate_use (dataflow_t, int);
322 static inline dataflow_t get_immediate_uses (tree);
323 static inline void set_default_def (tree, tree);
324 static inline tree default_def (tree);
326 /*---------------------------------------------------------------------------
327 Structure representing predictions in tree level.
328 ---------------------------------------------------------------------------*/
329 struct edge_prediction GTY((chain_next ("%h.next")))
331 struct edge_prediction *next;
332 edge edge;
333 enum br_predictor predictor;
334 int probability;
337 /*---------------------------------------------------------------------------
338 Block annotations stored in basic_block.tree_annotations
339 ---------------------------------------------------------------------------*/
340 struct bb_ann_d GTY(())
342 /* Chain of PHI nodes for this block. */
343 tree phi_nodes;
345 /* Number of predecessors for this block. This is only valid during
346 SSA rewriting. It is not maintained after conversion into SSA form. */
347 int num_preds;
349 /* Nonzero if this block is forwardable during cfg cleanups. This is also
350 used to detect loops during cfg cleanups. */
351 unsigned forwardable: 1;
353 /* Nonzero if this block contains an escape point (see is_escape_site). */
354 unsigned has_escape_site : 1;
356 /* Nonzero if one or more incoming edges to this block should be threaded
357 to an outgoing edge of this block. */
358 unsigned incoming_edge_threaded : 1;
360 struct edge_prediction *predictions;
363 typedef struct bb_ann_d *bb_ann_t;
365 /* Accessors for basic block annotations. */
366 static inline bb_ann_t bb_ann (basic_block);
367 static inline tree phi_nodes (basic_block);
368 static inline void set_phi_nodes (basic_block, tree);
370 /*---------------------------------------------------------------------------
371 Global declarations
372 ---------------------------------------------------------------------------*/
373 /* Array of all variables referenced in the function. */
374 extern GTY(()) varray_type referenced_vars;
376 #define num_referenced_vars VARRAY_ACTIVE_SIZE (referenced_vars)
377 #define referenced_var(i) VARRAY_TREE (referenced_vars, i)
379 /* Array of all SSA_NAMEs used in the function. */
380 extern GTY(()) varray_type ssa_names;
382 #define num_ssa_names VARRAY_ACTIVE_SIZE (ssa_names)
383 #define ssa_name(i) VARRAY_TREE (ssa_names, i)
385 /* Artificial variable used to model the effects of function calls. */
386 extern GTY(()) tree global_var;
388 /* Call clobbered variables in the function. If bit I is set, then
389 REFERENCED_VARS (I) is call-clobbered. */
390 extern bitmap call_clobbered_vars;
392 /* Addressable variables in the function. If bit I is set, then
393 REFERENCED_VARS (I) has had its address taken. */
394 extern bitmap addressable_vars;
396 /* 'true' after aliases have been computed (see compute_may_aliases). */
397 extern bool aliases_computed_p;
399 /* Macros for showing usage statistics. */
400 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
401 ? (x) \
402 : ((x) < 1024*1024*10 \
403 ? (x) / 1024 \
404 : (x) / (1024*1024))))
406 #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
408 #define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
411 /*---------------------------------------------------------------------------
412 Block iterators
413 ---------------------------------------------------------------------------*/
415 typedef struct {
416 tree_stmt_iterator tsi;
417 basic_block bb;
418 } block_stmt_iterator;
420 static inline block_stmt_iterator bsi_start (basic_block);
421 static inline block_stmt_iterator bsi_last (basic_block);
422 static inline block_stmt_iterator bsi_after_labels (basic_block);
423 block_stmt_iterator stmt_for_bsi (tree);
424 static inline bool bsi_end_p (block_stmt_iterator);
425 static inline void bsi_next (block_stmt_iterator *);
426 static inline void bsi_prev (block_stmt_iterator *);
427 static inline tree bsi_stmt (block_stmt_iterator);
428 static inline tree * bsi_stmt_ptr (block_stmt_iterator);
430 extern void bsi_remove (block_stmt_iterator *);
431 extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *);
432 extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *);
433 extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block);
435 enum bsi_iterator_update
437 /* Note that these are intentionally in the same order as TSI_FOO. They
438 mean exactly the same as their TSI_* counterparts. */
439 BSI_NEW_STMT,
440 BSI_SAME_STMT,
441 BSI_CHAIN_START,
442 BSI_CHAIN_END,
443 BSI_CONTINUE_LINKING
446 extern void bsi_insert_before (block_stmt_iterator *, tree,
447 enum bsi_iterator_update);
448 extern void bsi_insert_after (block_stmt_iterator *, tree,
449 enum bsi_iterator_update);
451 extern void bsi_replace (const block_stmt_iterator *, tree, bool);
453 /*---------------------------------------------------------------------------
454 Function prototypes
455 ---------------------------------------------------------------------------*/
456 /* In tree-cfg.c */
458 /* Location to track pending stmt for edge insertion. */
459 #define PENDING_STMT(e) ((e)->insns.t)
461 extern void delete_tree_cfg_annotations (void);
462 extern void disband_implicit_edges (void);
463 extern bool stmt_ends_bb_p (tree);
464 extern bool is_ctrl_stmt (tree);
465 extern bool is_ctrl_altering_stmt (tree);
466 extern bool computed_goto_p (tree);
467 extern bool simple_goto_p (tree);
468 extern void tree_dump_bb (basic_block, FILE *, int);
469 extern void debug_tree_bb (basic_block);
470 extern basic_block debug_tree_bb_n (int);
471 extern void dump_tree_cfg (FILE *, int);
472 extern void debug_tree_cfg (int);
473 extern void dump_cfg_stats (FILE *);
474 extern void debug_cfg_stats (void);
475 extern void debug_loop_ir (void);
476 extern void print_loop_ir (FILE *);
477 extern void cleanup_dead_labels (void);
478 extern void group_case_labels (void);
479 extern bool cleanup_tree_cfg (void);
480 extern tree first_stmt (basic_block);
481 extern tree last_stmt (basic_block);
482 extern tree *last_stmt_ptr (basic_block);
483 extern tree last_and_only_stmt (basic_block);
484 extern edge find_taken_edge (basic_block, tree);
485 extern void cfg_remove_useless_stmts (void);
486 extern edge thread_edge (edge, basic_block);
487 extern basic_block label_to_block (tree);
488 extern void tree_optimize_tail_calls (bool, enum tree_dump_index);
489 extern edge tree_block_forwards_to (basic_block bb);
490 extern void bsi_insert_on_edge (edge, tree);
491 extern basic_block bsi_insert_on_edge_immediate (edge, tree);
492 extern void bsi_commit_edge_inserts (int *);
493 extern void notice_special_calls (tree);
494 extern void clear_special_calls (void);
495 extern void verify_stmts (void);
496 extern tree tree_block_label (basic_block bb);
497 extern void extract_true_false_edges_from_block (basic_block, edge *, edge *);
498 extern bool tree_duplicate_sese_region (edge, edge, basic_block *, unsigned,
499 basic_block *);
500 extern void add_phi_args_after_copy_bb (basic_block);
501 extern void add_phi_args_after_copy (basic_block *, unsigned);
502 extern void rewrite_to_new_ssa_names_bb (basic_block, struct htab *);
503 extern void rewrite_to_new_ssa_names (basic_block *, unsigned, htab_t);
504 extern void allocate_ssa_names (bitmap, struct htab **);
505 extern bool tree_purge_dead_eh_edges (basic_block);
506 extern bool tree_purge_all_dead_eh_edges (bitmap);
507 extern tree gimplify_val (block_stmt_iterator *, tree, tree);
508 extern tree gimplify_build1 (block_stmt_iterator *, enum tree_code,
509 tree, tree);
510 extern tree gimplify_build2 (block_stmt_iterator *, enum tree_code,
511 tree, tree, tree);
512 extern tree gimplify_build3 (block_stmt_iterator *, enum tree_code,
513 tree, tree, tree, tree);
515 /* In tree-pretty-print.c. */
516 extern void dump_generic_bb (FILE *, basic_block, int, int);
518 /* In tree-dfa.c */
519 extern var_ann_t create_var_ann (tree);
520 extern stmt_ann_t create_stmt_ann (tree);
521 extern tree_ann_t create_tree_ann (tree);
522 extern tree create_phi_node (tree, basic_block);
523 extern void add_phi_arg (tree *, tree, edge);
524 extern void remove_phi_arg (tree, basic_block);
525 extern void remove_phi_arg_num (tree, int);
526 extern void remove_phi_node (tree, tree, basic_block);
527 extern void remove_all_phi_nodes_for (bitmap);
528 extern void dump_dfa_stats (FILE *);
529 extern void debug_dfa_stats (void);
530 extern void debug_referenced_vars (void);
531 extern void dump_referenced_vars (FILE *);
532 extern void dump_variable (FILE *, tree);
533 extern void debug_variable (tree);
534 extern void dump_immediate_uses (FILE *);
535 extern void debug_immediate_uses (void);
536 extern void dump_immediate_uses_for (FILE *, tree);
537 extern void debug_immediate_uses_for (tree);
538 extern void compute_immediate_uses (int, bool (*)(tree));
539 extern void free_df (void);
540 extern void free_df_for_stmt (tree);
541 extern tree get_virtual_var (tree);
542 extern void add_referenced_tmp_var (tree var);
543 extern void mark_new_vars_to_rename (tree, bitmap);
544 extern void redirect_immediate_uses (tree, tree);
545 extern tree make_rename_temp (tree, const char *);
547 /* Flags used when computing reaching definitions and reached uses. */
548 #define TDFA_USE_OPS 1 << 0
549 #define TDFA_USE_VOPS 1 << 1
551 /* In gimple-low.c */
552 struct lower_data;
553 extern void lower_stmt_body (tree, struct lower_data *);
554 extern void record_vars (tree);
555 extern bool block_may_fallthru (tree block);
557 /* In tree-ssa-alias.c */
558 extern void dump_may_aliases_for (FILE *, tree);
559 extern void debug_may_aliases_for (tree);
560 extern void dump_alias_info (FILE *);
561 extern void debug_alias_info (void);
562 extern void dump_points_to_info (FILE *);
563 extern void debug_points_to_info (void);
564 extern void dump_points_to_info_for (FILE *, tree);
565 extern void debug_points_to_info_for (tree);
566 extern bool may_be_aliased (tree);
568 /* Call-back function for walk_use_def_chains(). At each reaching
569 definition, a function with this prototype is called. */
570 typedef bool (*walk_use_def_chains_fn) (tree, tree, void *);
572 /* In tree-ssa.c */
573 extern void init_tree_ssa (void);
574 extern void dump_reaching_defs (FILE *);
575 extern void debug_reaching_defs (void);
576 extern void dump_tree_ssa (FILE *);
577 extern void debug_tree_ssa (void);
578 extern void debug_def_blocks (void);
579 extern void dump_tree_ssa_stats (FILE *);
580 extern void debug_tree_ssa_stats (void);
581 extern void ssa_remove_edge (edge);
582 extern edge ssa_redirect_edge (edge, basic_block);
583 extern bool tree_ssa_useless_type_conversion (tree);
584 extern bool tree_ssa_useless_type_conversion_1 (tree, tree);
585 extern void verify_ssa (void);
586 extern void delete_tree_ssa (void);
587 extern void register_new_def (tree, varray_type *);
588 extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
589 extern void kill_redundant_phi_nodes (void);
591 /* In tree-into-ssa.c */
592 extern void rewrite_into_ssa (bool);
593 extern void rewrite_ssa_into_ssa (void);
595 void compute_global_livein (bitmap, bitmap);
596 tree duplicate_ssa_name (tree, tree);
598 /* In tree-ssa-ccp.c */
599 bool fold_stmt (tree *);
600 tree widen_bitfield (tree, tree, tree);
602 /* In tree-ssa-dom.c */
603 extern void dump_dominator_optimization_stats (FILE *);
604 extern void debug_dominator_optimization_stats (void);
606 /* In tree-ssa-copy.c */
607 extern void propagate_value (use_operand_p, tree);
608 extern void propagate_tree_value (tree *, tree);
609 extern void replace_exp (use_operand_p, tree);
610 extern bool may_propagate_copy (tree, tree);
612 /* Description of number of iterations of a loop. All the expressions inside
613 the structure can be evaluated at the end of the loop's preheader
614 (and due to ssa form, also anywhere inside the body of the loop). */
616 struct tree_niter_desc
618 tree assumptions; /* The boolean expression. If this expression evaluates
619 to false, then the other fields in this structure
620 should not be used; there is no guarantee that they
621 will be correct. */
622 tree may_be_zero; /* The boolean expression. If it evaluates to true,
623 the loop will exit in the first iteration (i.e.
624 its latch will not be executed), even if the niter
625 field says otherwise. */
626 tree niter; /* The expression giving the number of iterations of
627 a loop (provided that assumptions == true and
628 may_be_zero == false), more precisely the number
629 of executions of the latch of the loop. */
630 tree additional_info; /* The boolean expression. Sometimes we use additional
631 knowledge to simplify the other expressions
632 contained in this structure (for example the
633 knowledge about value ranges of operands on entry to
634 the loop). If this is a case, conjunction of such
635 condition is stored in this field, so that we do not
636 lose the information: for example if may_be_zero
637 is (n <= 0) and niter is (unsigned) n, we know
638 that the number of iterations is at most
639 MAX_SIGNED_INT. However if the (n <= 0) assumption
640 is eliminated (by looking at the guard on entry of
641 the loop), then the information would be lost. */
644 /* In tree-vectorizer.c */
645 void vectorize_loops (struct loops *);
647 /* In tree-ssa-phiopt.c */
648 bool empty_block_p (basic_block);
650 /* In tree-ssa-loop*.c */
652 void tree_ssa_lim (struct loops *);
653 void canonicalize_induction_variables (struct loops *);
654 void tree_unroll_loops_completely (struct loops *);
655 void tree_ssa_iv_optimize (struct loops *);
657 void number_of_iterations_cond (tree, tree, tree, enum tree_code, tree, tree,
658 struct tree_niter_desc *);
659 bool number_of_iterations_exit (struct loop *, edge,
660 struct tree_niter_desc *niter);
661 tree loop_niter_by_eval (struct loop *, edge);
662 tree find_loop_niter_by_eval (struct loop *, edge *);
663 void estimate_numbers_of_iterations (struct loops *);
664 tree can_count_iv_in_wider_type (struct loop *, tree, tree, tree, tree);
665 void free_numbers_of_iterations_estimates (struct loops *);
666 void rewrite_into_loop_closed_ssa (void);
667 void verify_loop_closed_ssa (void);
668 void loop_commit_inserts (void);
669 bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
670 void create_iv (tree, tree, tree, struct loop *, block_stmt_iterator *, bool,
671 tree *, tree *);
672 void split_loop_exit_edge (edge);
673 basic_block bsi_insert_on_edge_immediate_loop (edge, tree);
674 void standard_iv_increment_position (struct loop *, block_stmt_iterator *,
675 bool *);
676 basic_block ip_end_pos (struct loop *);
677 basic_block ip_normal_pos (struct loop *);
679 /* In tree-ssa-loop-im.c */
680 /* The possibilities of statement movement. */
682 enum move_pos
684 MOVE_IMPOSSIBLE, /* No movement -- side effect expression. */
685 MOVE_PRESERVE_EXECUTION, /* Must not cause the non-executed statement
686 become executed -- memory accesses, ... */
687 MOVE_POSSIBLE /* Unlimited movement. */
689 extern enum move_pos movement_possibility (tree);
691 /* In tree-if-conv.c */
692 bool tree_if_conversion (struct loop *, bool);
695 /* In tree-flow-inline.h */
696 static inline int phi_arg_from_edge (tree, edge);
697 static inline bool is_call_clobbered (tree);
698 static inline void mark_call_clobbered (tree);
699 static inline void set_is_used (tree);
701 /* In tree-eh.c */
702 extern void make_eh_edges (tree);
703 extern bool tree_could_trap_p (tree);
704 extern bool tree_could_throw_p (tree);
705 extern bool tree_can_throw_internal (tree);
706 extern bool tree_can_throw_external (tree);
707 extern int lookup_stmt_eh_region (tree);
708 extern void add_stmt_to_eh_region (tree, int);
709 extern bool remove_stmt_from_eh_region (tree);
710 extern bool maybe_clean_eh_stmt (tree);
712 /* In tree-ssa-pre.c */
713 void add_to_value (tree, tree);
714 void debug_value_expressions (tree);
715 void print_value_expressions (FILE *, tree);
718 /* In tree-vn.c */
719 bool expressions_equal_p (tree, tree);
720 tree get_value_handle (tree);
721 hashval_t vn_compute (tree, hashval_t, vuse_optype);
722 tree vn_lookup_or_add (tree, vuse_optype);
723 void vn_add (tree, tree, vuse_optype);
724 tree vn_lookup (tree, vuse_optype);
725 void vn_init (void);
726 void vn_delete (void);
729 /* In tree-sra.c */
730 void insert_edge_copies (tree stmt, basic_block bb);
732 /* In tree-ssa-operands.c */
733 extern void build_ssa_operands (tree, stmt_ann_t, stmt_operands_p,
734 stmt_operands_p);
736 /* In tree-loop-linear.c */
737 extern void linear_transform_loops (struct loops *);
739 /* In gimplify.c */
741 tree force_gimple_operand (tree, tree *, bool, tree);
743 #include "tree-flow-inline.h"
745 #endif /* _TREE_FLOW_H */