OSDN Git Service

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