00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TREE_FLOW_H
00023 #define _TREE_FLOW_H 1
00024
00025 #include "bitmap.h"
00026 #include "hard-reg-set.h"
00027 #include "basic-block.h"
00028 #include "hashtab.h"
00029 #include "tree-gimple.h"
00030 #include "tree-ssa-operands.h"
00031 #include "cgraph.h"
00032 #include "ipa-reference.h"
00033
00034
00035 #ifndef GCC_BASIC_BLOCK_H
00036 struct edge_def;
00037 typedef struct edge_def *edge;
00038 struct basic_block_def;
00039 typedef struct basic_block_def *basic_block;
00040 #endif
00041
00042
00043 extern bool in_ssa_p;
00044
00045 typedef struct
00046 {
00047 htab_t htab;
00048 PTR *slot;
00049 PTR *limit;
00050 } htab_iterator;
00051
00052
00053
00054 #define FOR_EACH_HTAB_ELEMENT(HTAB, RESULT, TYPE, ITER) \
00055 for (RESULT = (TYPE) first_htab_element (&(ITER), (HTAB)); \
00056 !end_htab_p (&(ITER)); \
00057 RESULT = (TYPE) next_htab_element (&(ITER)))
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 struct ptr_info_def GTY(())
00070 {
00071
00072
00073 unsigned int pt_anything : 1;
00074
00075
00076 unsigned int value_escapes_p : 1;
00077
00078
00079 unsigned int is_dereferenced : 1;
00080
00081
00082 unsigned int pt_global_mem : 1;
00083
00084
00085 unsigned int pt_null : 1;
00086
00087
00088 bitmap pt_vars;
00089
00090
00091
00092
00093
00094 tree name_mem_tag;
00095
00096
00097 unsigned int escape_mask;
00098 };
00099
00100
00101
00102
00103
00104 enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN, STMT_ANN };
00105
00106 struct tree_ann_common_d GTY(())
00107 {
00108
00109 enum tree_ann_type type;
00110
00111
00112
00113 PTR GTY ((skip (""))) aux;
00114
00115
00116 tree GTY((skip)) value_handle;
00117 };
00118
00119
00120
00121
00122
00123 enum need_phi_state {
00124
00125
00126
00127 NEED_PHI_STATE_UNKNOWN,
00128
00129
00130
00131
00132
00133
00134 NEED_PHI_STATE_NO,
00135
00136
00137
00138
00139
00140 NEED_PHI_STATE_MAYBE
00141 };
00142
00143 struct subvar;
00144 typedef struct subvar *subvar_t;
00145
00146
00147 struct subvar GTY(())
00148 {
00149
00150 tree var;
00151
00152
00153 subvar_t next;
00154 };
00155
00156 struct var_ann_d GTY(())
00157 {
00158 struct tree_ann_common_d common;
00159
00160
00161
00162 unsigned out_of_ssa_tag : 1;
00163
00164
00165 unsigned root_var_processed : 1;
00166
00167
00168 unsigned is_aliased : 1;
00169
00170
00171
00172 unsigned used : 1;
00173
00174
00175
00176
00177 ENUM_BITFIELD (need_phi_state) need_phi_state : 2;
00178
00179
00180
00181 unsigned in_vuse_list : 1;
00182
00183
00184
00185 unsigned in_v_may_def_list : 1;
00186
00187
00188
00189
00190
00191 tree symbol_mem_tag;
00192
00193
00194 VEC(tree, gc) *may_aliases;
00195
00196
00197
00198 unsigned partition;
00199
00200
00201 unsigned root_index;
00202
00203
00204
00205 tree current_def;
00206
00207
00208
00209 subvar_t subvars;
00210
00211
00212
00213 unsigned int escape_mask;
00214 };
00215
00216 struct function_ann_d GTY(())
00217 {
00218 struct tree_ann_common_d common;
00219
00220
00221
00222
00223 ipa_reference_vars_info_t GTY ((skip)) reference_vars_info;
00224 };
00225
00226 typedef struct immediate_use_iterator_d
00227 {
00228
00229 ssa_use_operand_t *imm_use;
00230
00231 ssa_use_operand_t *end_p;
00232
00233 ssa_use_operand_t iter_node;
00234
00235
00236 ssa_use_operand_t *next_imm_name;
00237 } imm_use_iterator;
00238
00239
00240
00241
00242
00243 #define FOR_EACH_IMM_USE_FAST(DEST, ITER, SSAVAR) \
00244 for ((DEST) = first_readonly_imm_use (&(ITER), (SSAVAR)); \
00245 !end_readonly_imm_use_p (&(ITER)); \
00246 (DEST) = next_readonly_imm_use (&(ITER)))
00247
00248
00249
00250 #define FOR_EACH_IMM_USE_STMT(STMT, ITER, SSAVAR) \
00251 for ((STMT) = first_imm_use_stmt (&(ITER), (SSAVAR)); \
00252 !end_imm_use_stmt_p (&(ITER)); \
00253 (STMT) = next_imm_use_stmt (&(ITER)))
00254
00255
00256
00257
00258 #define BREAK_FROM_IMM_USE_STMT(ITER) \
00259 { \
00260 end_imm_use_stmt_traverse (&(ITER)); \
00261 break; \
00262 }
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278 #define FOR_EACH_IMM_USE_ON_STMT(DEST, ITER) \
00279 for ((DEST) = first_imm_use_on_stmt (&(ITER)); \
00280 !end_imm_use_on_stmt_p (&(ITER)); \
00281 (DEST) = next_imm_use_on_stmt (&(ITER)))
00282
00283
00284
00285 struct stmt_ann_d GTY(())
00286 {
00287 struct tree_ann_common_d common;
00288
00289
00290
00291 unsigned modified : 1;
00292
00293
00294 unsigned has_volatile_ops : 1;
00295
00296
00297
00298 unsigned makes_clobbering_call : 1;
00299
00300
00301 basic_block bb;
00302
00303
00304 struct stmt_operands_d GTY ((skip (""))) operands;
00305
00306
00307 bitmap addresses_taken;
00308
00309
00310
00311
00312 unsigned int uid;
00313
00314
00315
00316
00317
00318 void * GTY ((skip (""))) histograms;
00319 };
00320
00321 union tree_ann_d GTY((desc ("ann_type ((tree_ann_t)&%h)")))
00322 {
00323 struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
00324 struct var_ann_d GTY((tag ("VAR_ANN"))) vdecl;
00325 struct function_ann_d GTY((tag ("FUNCTION_ANN"))) fdecl;
00326 struct stmt_ann_d GTY((tag ("STMT_ANN"))) stmt;
00327 };
00328
00329 extern GTY(()) VEC(tree,gc) *modified_noreturn_calls;
00330
00331 typedef union tree_ann_d *tree_ann_t;
00332 typedef struct var_ann_d *var_ann_t;
00333 typedef struct function_ann_d *function_ann_t;
00334 typedef struct stmt_ann_d *stmt_ann_t;
00335 typedef struct tree_ann_common_d *tree_ann_common_t;
00336
00337 static inline tree_ann_common_t tree_common_ann (tree);
00338 static inline tree_ann_common_t get_tree_common_ann (tree);
00339 static inline var_ann_t var_ann (tree);
00340 static inline var_ann_t get_var_ann (tree);
00341 static inline function_ann_t function_ann (tree);
00342 static inline function_ann_t get_function_ann (tree);
00343 static inline stmt_ann_t stmt_ann (tree);
00344 static inline stmt_ann_t get_stmt_ann (tree);
00345 static inline enum tree_ann_type ann_type (tree_ann_t);
00346 static inline basic_block bb_for_stmt (tree);
00347 extern void set_bb_for_stmt (tree, basic_block);
00348 static inline bool noreturn_call_p (tree);
00349 static inline void update_stmt (tree);
00350 static inline bool stmt_modified_p (tree);
00351 static inline VEC(tree, gc) *may_aliases (tree);
00352 static inline int get_lineno (tree);
00353 static inline const char *get_filename (tree);
00354 static inline bool is_exec_stmt (tree);
00355 static inline bool is_label_stmt (tree);
00356 static inline bitmap addresses_taken (tree);
00357
00358 /*---------------------------------------------------------------------------
00359 Structure representing predictions in tree level.
00360 ---------------------------------------------------------------------------*/
00361 struct edge_prediction GTY((chain_next ("%h.ep_next")))
00362 {
00363 struct edge_prediction *ep_next;
00364 edge ep_edge;
00365 enum br_predictor ep_predictor;
00366 int ep_probability;
00367 };
00368
00369 /* Accessors for basic block annotations. */
00370 static inline tree phi_nodes (basic_block);
00371 static inline void set_phi_nodes (basic_block, tree);
00372
00373 /*---------------------------------------------------------------------------
00374 Global declarations
00375 ---------------------------------------------------------------------------*/
00376 struct int_tree_map GTY(())
00377 {
00378
00379 unsigned int uid;
00380 tree to;
00381 };
00382
00383 extern unsigned int int_tree_map_hash (const void *);
00384 extern int int_tree_map_eq (const void *, const void *);
00385
00386 typedef struct
00387 {
00388 htab_iterator hti;
00389 } referenced_var_iterator;
00390
00391
00392 /* This macro loops over all the referenced vars, one at a time, putting the
00393 current var in VAR. Note: You are not allowed to add referenced variables
00394 to the hashtable while using this macro. Doing so may cause it to behave
00395 erratically. */
00396
00397 #define FOR_EACH_REFERENCED_VAR(VAR, ITER) \
00398 for ((VAR) = first_referenced_var (&(ITER)); \
00399 !end_referenced_vars_p (&(ITER)); \
00400 (VAR) = next_referenced_var (&(ITER)))
00401
00402
00403 typedef struct
00404 {
00405 int i;
00406 } safe_referenced_var_iterator;
00407
00408 /* This macro loops over all the referenced vars, one at a time, putting the
00409 current var in VAR. You are allowed to add referenced variables during the
00410 execution of this macro, however, the macro will not iterate over them. It
00411 requires a temporary vector of trees, VEC, whose lifetime is controlled by
00412 the caller. The purpose of the vector is to temporarily store the
00413 referenced_variables hashtable so that adding referenced variables does not
00414 affect the hashtable. */
00415
00416 #define FOR_EACH_REFERENCED_VAR_SAFE(VAR, VEC, ITER) \
00417 for ((ITER).i = 0, fill_referenced_var_vec (&(VEC)); \
00418 VEC_iterate (tree, (VEC), (ITER).i, (VAR)); \
00419 (ITER).i++)
00420
00421 /* Array of all variables referenced in the function. */
00422 extern GTY((param_is (struct int_tree_map))) htab_t referenced_vars;
00423
00424 /* Default defs for undefined symbols. */
00425 extern GTY((param_is (struct int_tree_map))) htab_t default_defs;
00426
00427 extern tree referenced_var_lookup (unsigned int);
00428 extern bool referenced_var_check_and_insert (tree);
00429 #define num_referenced_vars htab_elements (referenced_vars)
00430 #define referenced_var(i) referenced_var_lookup (i)
00431
00432 /* Array of all SSA_NAMEs used in the function. */
00433 extern GTY(()) VEC(tree,gc) *ssa_names;
00434
00435 #define num_ssa_names (VEC_length (tree, ssa_names))
00436 #define ssa_name(i) (VEC_index (tree, ssa_names, (i)))
00437
00438 /* Artificial variable used to model the effects of function calls. */
00439 extern GTY(()) tree global_var;
00440
00441 /* Artificial variable used to model the effects of nonlocal
00442 variables. */
00443 extern GTY(()) tree nonlocal_all;
00444
00445 /* Call clobbered variables in the function. If bit I is set, then
00446 REFERENCED_VARS (I) is call-clobbered. */
00447 extern bitmap call_clobbered_vars;
00448
00449 /* Addressable variables in the function. If bit I is set, then
00450 REFERENCED_VARS (I) has had its address taken. */
00451 extern bitmap addressable_vars;
00452
00453 /* 'true' after aliases have been computed (see compute_may_aliases). */
00454 extern bool aliases_computed_p;
00455
00456 /* Macros for showing usage statistics. */
00457 #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
00458 ? (x) \
00459 : ((x) < 1024*1024*10 \
00460 ? (x) / 1024 \
00461 : (x) / (1024*1024))))
00462
00463 #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
00464
00465 #define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
00466
00467 /*---------------------------------------------------------------------------
00468 Block iterators
00469 ---------------------------------------------------------------------------*/
00470
00471 typedef struct {
00472 tree_stmt_iterator tsi;
00473 basic_block bb;
00474 } block_stmt_iterator;
00475
00476 static inline block_stmt_iterator bsi_start (basic_block);
00477 static inline block_stmt_iterator bsi_last (basic_block);
00478 static inline block_stmt_iterator bsi_after_labels (basic_block);
00479 block_stmt_iterator bsi_for_stmt (tree);
00480 static inline bool bsi_end_p (block_stmt_iterator);
00481 static inline void bsi_next (block_stmt_iterator *);
00482 static inline void bsi_prev (block_stmt_iterator *);
00483 static inline tree bsi_stmt (block_stmt_iterator);
00484 static inline tree * bsi_stmt_ptr (block_stmt_iterator);
00485
00486 extern void bsi_remove (block_stmt_iterator *, bool);
00487 extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *);
00488 extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *);
00489 extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block);
00490
00491 enum bsi_iterator_update
00492 {
00493 /* Note that these are intentionally in the same order as TSI_FOO. They
00494 mean exactly the same as their TSI_* counterparts. */
00495 BSI_NEW_STMT,
00496 BSI_SAME_STMT,
00497 BSI_CHAIN_START,
00498 BSI_CHAIN_END,
00499 BSI_CONTINUE_LINKING
00500 };
00501
00502 extern void bsi_insert_before (block_stmt_iterator *, tree,
00503 enum bsi_iterator_update);
00504 extern void bsi_insert_after (block_stmt_iterator *, tree,
00505 enum bsi_iterator_update);
00506
00507 extern void bsi_replace (const block_stmt_iterator *, tree, bool);
00508
00509 /*---------------------------------------------------------------------------
00510 OpenMP Region Tree
00511 ---------------------------------------------------------------------------*/
00512
00513 /* Parallel region information. Every parallel and workshare
00514 directive is enclosed between two markers, the OMP_* directive
00515 and a corresponding OMP_RETURN statement. */
00516
00517 struct omp_region
00518 {
00519 /* The enclosing region. */
00520 struct omp_region *outer;
00521
00522 /* First child region. */
00523 struct omp_region *inner;
00524
00525 /* Next peer region. */
00526 struct omp_region *next;
00527
00528 /* Block containing the omp directive as its last stmt. */
00529 basic_block entry;
00530
00531 /* Block containing the OMP_RETURN as its last stmt. */
00532 basic_block exit;
00533
00534 /* Block containing the OMP_CONTINUE as its last stmt. */
00535 basic_block cont;
00536
00537 /* If this is a combined parallel+workshare region, this is a list
00538 of additional arguments needed by the combined parallel+workshare
00539 library call. */
00540 tree ws_args;
00541
00542 /* The code for the omp directive of this region. */
00543 enum tree_code type;
00544
00545 /* Schedule kind, only used for OMP_FOR type regions. */
00546 enum omp_clause_schedule_kind sched_kind;
00547
00548 /* True if this is a combined parallel+workshare region. */
00549 bool is_combined_parallel;
00550 };
00551
00552 extern struct omp_region *root_omp_region;
00553 extern struct omp_region *new_omp_region (basic_block, enum tree_code,
00554 struct omp_region *);
00555 extern void free_omp_regions (void);
00556
00557 /*---------------------------------------------------------------------------
00558 Function prototypes
00559 ---------------------------------------------------------------------------*/
00560 /* In tree-cfg.c */
00561
00562 /* Location to track pending stmt for edge insertion. */
00563 #define PENDING_STMT(e) ((e)->insns.t)
00564
00565 extern void delete_tree_cfg_annotations (void);
00566 extern void disband_implicit_edges (void);
00567 extern bool stmt_ends_bb_p (tree);
00568 extern bool is_ctrl_stmt (tree);
00569 extern bool is_ctrl_altering_stmt (tree);
00570 extern bool computed_goto_p (tree);
00571 extern bool simple_goto_p (tree);
00572 extern bool tree_can_make_abnormal_goto (tree);
00573 extern basic_block single_noncomplex_succ (basic_block bb);
00574 extern void tree_dump_bb (basic_block, FILE *, int);
00575 extern void debug_tree_bb (basic_block);
00576 extern basic_block debug_tree_bb_n (int);
00577 extern void dump_tree_cfg (FILE *, int);
00578 extern void debug_tree_cfg (int);
00579 extern void dump_cfg_stats (FILE *);
00580 extern void debug_cfg_stats (void);
00581 extern void debug_loop_ir (void);
00582 extern void print_loop_ir (FILE *);
00583 extern void cleanup_dead_labels (void);
00584 extern void group_case_labels (void);
00585 extern tree first_stmt (basic_block);
00586 extern tree last_stmt (basic_block);
00587 extern tree *last_stmt_ptr (basic_block);
00588 extern tree last_and_only_stmt (basic_block);
00589 extern edge find_taken_edge (basic_block, tree);
00590 extern basic_block label_to_block_fn (struct function *, tree);
00591 #define label_to_block(t) (label_to_block_fn (cfun, t))
00592 extern void bsi_insert_on_edge (edge, tree);
00593 extern basic_block bsi_insert_on_edge_immediate (edge, tree);
00594 extern void bsi_commit_one_edge_insert (edge, basic_block *);
00595 extern void bsi_commit_edge_inserts (void);
00596 extern void notice_special_calls (tree);
00597 extern void clear_special_calls (void);
00598 extern void verify_stmts (void);
00599 extern tree tree_block_label (basic_block);
00600 extern void extract_true_false_edges_from_block (basic_block, edge *, edge *);
00601 extern bool tree_duplicate_sese_region (edge, edge, basic_block *, unsigned,
00602 basic_block *);
00603 extern void add_phi_args_after_copy_bb (basic_block);
00604 extern void add_phi_args_after_copy (basic_block *, unsigned);
00605 extern bool tree_purge_dead_abnormal_call_edges (basic_block);
00606 extern bool tree_purge_dead_eh_edges (basic_block);
00607 extern bool tree_purge_all_dead_eh_edges (bitmap);
00608 extern tree gimplify_val (block_stmt_iterator *, tree, tree);
00609 extern tree gimplify_build1 (block_stmt_iterator *, enum tree_code,
00610 tree, tree);
00611 extern tree gimplify_build2 (block_stmt_iterator *, enum tree_code,
00612 tree, tree, tree);
00613 extern tree gimplify_build3 (block_stmt_iterator *, enum tree_code,
00614 tree, tree, tree, tree);
00615 extern void init_empty_tree_cfg (void);
00616 extern void fold_cond_expr_cond (void);
00617 extern void make_abnormal_goto_edges (basic_block, bool);
00618 extern void replace_uses_by (tree, tree);
00619 extern void start_recording_case_labels (void);
00620 extern void end_recording_case_labels (void);
00621 extern basic_block move_sese_region_to_fn (struct function *, basic_block,
00622 basic_block);
00623
00624 /* In tree-cfgcleanup.c */
00625 extern bool cleanup_tree_cfg (void);
00626 extern void cleanup_tree_cfg_loop (void);
00627
00628 /* In tree-pretty-print.c. */
00629 extern void dump_generic_bb (FILE *, basic_block, int, int);
00630
00631 /* In tree-dfa.c */
00632 extern var_ann_t create_var_ann (tree);
00633 extern function_ann_t create_function_ann (tree);
00634 extern stmt_ann_t create_stmt_ann (tree);
00635 extern tree_ann_common_t create_tree_common_ann (tree);
00636 extern void dump_dfa_stats (FILE *);
00637 extern void debug_dfa_stats (void);
00638 extern void debug_referenced_vars (void);
00639 extern void dump_referenced_vars (FILE *);
00640 extern void dump_variable (FILE *, tree);
00641 extern void debug_variable (tree);
00642 extern void dump_subvars_for (FILE *, tree);
00643 extern void debug_subvars_for (tree);
00644 extern tree get_virtual_var (tree);
00645 extern void add_referenced_var (tree);
00646 extern void mark_new_vars_to_rename (tree);
00647 extern void find_new_referenced_vars (tree *);
00648
00649 extern tree make_rename_temp (tree, const char *);
00650 extern void set_default_def (tree, tree);
00651 extern tree default_def (tree);
00652 extern tree default_def_fn (struct function *, tree);
00653
00654 /* In tree-phinodes.c */
00655 extern void reserve_phi_args_for_new_edge (basic_block);
00656 extern tree create_phi_node (tree, basic_block);
00657 extern void add_phi_arg (tree, tree, edge);
00658 extern void remove_phi_args (edge);
00659 extern void remove_phi_node (tree, tree);
00660 extern tree phi_reverse (tree);
00661
00662 /* In gimple-low.c */
00663 extern void record_vars_into (tree, tree);
00664 extern void record_vars (tree);
00665 extern bool block_may_fallthru (tree);
00666
00667 /* In tree-ssa-alias.c */
00668 extern void dump_may_aliases_for (FILE *, tree);
00669 extern void debug_may_aliases_for (tree);
00670 extern void dump_alias_info (FILE *);
00671 extern void debug_alias_info (void);
00672 extern void dump_points_to_info (FILE *);
00673 extern void debug_points_to_info (void);
00674 extern void dump_points_to_info_for (FILE *, tree);
00675 extern void debug_points_to_info_for (tree);
00676 extern bool may_be_aliased (tree);
00677 extern bool is_aliased_with (tree, tree);
00678 extern bool may_aliases_intersect (tree, tree);
00679 extern struct ptr_info_def *get_ptr_info (tree);
00680 extern void new_type_alias (tree, tree, tree);
00681 extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *, bool *);
00682 static inline subvar_t get_subvars_for_var (tree);
00683 static inline tree get_subvar_at (tree, unsigned HOST_WIDE_INT);
00684 static inline bool ref_contains_array_ref (tree);
00685 static inline bool array_ref_contains_indirect_ref (tree);
00686 extern tree get_ref_base_and_extent (tree, HOST_WIDE_INT *,
00687 HOST_WIDE_INT *, HOST_WIDE_INT *);
00688 static inline bool var_can_have_subvars (tree);
00689 static inline bool overlap_subvar (unsigned HOST_WIDE_INT,
00690 unsigned HOST_WIDE_INT,
00691 tree, bool *);
00692
00693 /* Call-back function for walk_use_def_chains(). At each reaching
00694 definition, a function with this prototype is called. */
00695 typedef bool (*walk_use_def_chains_fn) (tree, tree, void *);
00696
00697
00698 /* In tree-ssa.c */
00699 extern void init_tree_ssa (void);
00700 extern edge ssa_redirect_edge (edge, basic_block);
00701 extern void flush_pending_stmts (edge);
00702 extern bool tree_ssa_useless_type_conversion (tree);
00703 extern bool tree_ssa_useless_type_conversion_1 (tree, tree);
00704 extern void verify_ssa (bool);
00705 extern void delete_tree_ssa (void);
00706 extern void register_new_def (tree, VEC(tree,heap) **);
00707 extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
00708 extern bool stmt_references_memory_p (tree);
00709
00710 /* In tree-into-ssa.c */
00711 void update_ssa (unsigned);
00712 void delete_update_ssa (void);
00713 void register_new_name_mapping (tree, tree);
00714 tree create_new_def_for (tree, tree, def_operand_p);
00715 bool need_ssa_update_p (void);
00716 bool name_registered_for_update_p (tree);
00717 bitmap ssa_names_to_replace (void);
00718 void release_ssa_name_after_update_ssa (tree name);
00719 void compute_global_livein (bitmap, bitmap);
00720 tree duplicate_ssa_name (tree, tree);
00721 void mark_sym_for_renaming (tree);
00722 void mark_set_for_renaming (bitmap);
00723 tree get_current_def (tree);
00724 void set_current_def (tree, tree);
00725
00726 /* In tree-ssa-ccp.c */
00727 bool fold_stmt (tree *);
00728 bool fold_stmt_inplace (tree);
00729 tree widen_bitfield (tree, tree, tree);
00730
00731 /* In tree-vrp.c */
00732 tree vrp_evaluate_conditional (tree, tree);
00733 void simplify_stmt_using_ranges (tree);
00734
00735 /* In tree-ssa-dom.c */
00736 extern void dump_dominator_optimization_stats (FILE *);
00737 extern void debug_dominator_optimization_stats (void);
00738 int loop_depth_of_name (tree);
00739
00740 /* In tree-ssa-copy.c */
00741 extern void merge_alias_info (tree, tree);
00742 extern void propagate_value (use_operand_p, tree);
00743 extern void propagate_tree_value (tree *, tree);
00744 extern void replace_exp (use_operand_p, tree);
00745 extern bool may_propagate_copy (tree, tree);
00746 extern bool may_propagate_copy_into_asm (tree);
00747
00748 /* Affine iv. */
00749
00750 typedef struct
00751 {
00752 /* Iv = BASE + STEP * i. */
00753 tree base, step;
00754
00755 /* True if this iv does not overflow. */
00756 bool no_overflow;
00757 } affine_iv;
00758
00759 /* Description of number of iterations of a loop. All the expressions inside
00760 the structure can be evaluated at the end of the loop's preheader
00761 (and due to ssa form, also anywhere inside the body of the loop). */
00762
00763 struct tree_niter_desc
00764 {
00765 tree assumptions; /* The boolean expression. If this expression evaluates
00766 to false, then the other fields in this structure
00767 should not be used; there is no guarantee that they
00768 will be correct. */
00769 tree may_be_zero; /* The boolean expression. If it evaluates to true,
00770 the loop will exit in the first iteration (i.e.
00771 its latch will not be executed), even if the niter
00772 field says otherwise. */
00773 tree niter; /* The expression giving the number of iterations of
00774 a loop (provided that assumptions == true and
00775 may_be_zero == false), more precisely the number
00776 of executions of the latch of the loop. */
00777 tree additional_info; /* The boolean expression. Sometimes we use additional
00778 knowledge to simplify the other expressions
00779 contained in this structure (for example the
00780 knowledge about value ranges of operands on entry to
00781 the loop). If this is a case, conjunction of such
00782 condition is stored in this field, so that we do not
00783 lose the information: for example if may_be_zero
00784 is (n <= 0) and niter is (unsigned) n, we know
00785 that the number of iterations is at most
00786 MAX_SIGNED_INT. However if the (n <= 0) assumption
00787 is eliminated (by looking at the guard on entry of
00788 the loop), then the information would be lost. */
00789
00790 /* The simplified shape of the exit condition. The loop exits if
00791 CONTROL CMP BOUND is false, where CMP is one of NE_EXPR,
00792 LT_EXPR, or GT_EXPR, and step of CONTROL is positive if CMP is
00793 LE_EXPR and negative if CMP is GE_EXPR. This information is used
00794 by loop unrolling. */
00795 affine_iv control;
00796 tree bound;
00797 enum tree_code cmp;
00798 };
00799
00800 /* In tree-vectorizer.c */
00801 void vectorize_loops (struct loops *);
00802 extern bool vect_can_force_dr_alignment_p (tree, unsigned int);
00803 extern tree get_vectype_for_scalar_type (tree);
00804
00805 /* In tree-ssa-phiopt.c */
00806 bool empty_block_p (basic_block);
00807
00808 /* In tree-ssa-loop*.c */
00809
00810 void tree_ssa_lim (struct loops *);
00811 unsigned int tree_ssa_unswitch_loops (struct loops *);
00812 unsigned int canonicalize_induction_variables (struct loops *);
00813 unsigned int tree_unroll_loops_completely (struct loops *, bool);
00814 unsigned int tree_ssa_prefetch_arrays (struct loops *);
00815 unsigned int remove_empty_loops (struct loops *);
00816 void tree_ssa_iv_optimize (struct loops *);
00817
00818 bool number_of_iterations_exit (struct loop *, edge,
00819 struct tree_niter_desc *niter, bool);
00820 tree find_loop_niter (struct loop *, edge *);
00821 tree loop_niter_by_eval (struct loop *, edge);
00822 tree find_loop_niter_by_eval (struct loop *, edge *);
00823 void estimate_numbers_of_iterations (struct loops *);
00824 bool scev_probably_wraps_p (tree, tree, tree, struct loop *, bool);
00825 bool convert_affine_scev (struct loop *, tree, tree *, tree *, tree, bool);
00826
00827 bool nowrap_type_p (tree);
00828 enum ev_direction {EV_DIR_GROWS, EV_DIR_DECREASES, EV_DIR_UNKNOWN};
00829 enum ev_direction scev_direction (tree);
00830
00831 void free_numbers_of_iterations_estimates (struct loops *);
00832 void free_numbers_of_iterations_estimates_loop (struct loop *);
00833 void rewrite_into_loop_closed_ssa (bitmap, unsigned);
00834 void verify_loop_closed_ssa (void);
00835 void loop_commit_inserts (void);
00836 bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
00837 void create_iv (tree, tree, tree, struct loop *, block_stmt_iterator *, bool,
00838 tree *, tree *);
00839 void split_loop_exit_edge (edge);
00840 unsigned force_expr_to_var_cost (tree);
00841 basic_block bsi_insert_on_edge_immediate_loop (edge, tree);
00842 void standard_iv_increment_position (struct loop *, block_stmt_iterator *,
00843 bool *);
00844 basic_block ip_end_pos (struct loop *);
00845 basic_block ip_normal_pos (struct loop *);
00846 bool tree_duplicate_loop_to_header_edge (struct loop *, edge, struct loops *,
00847 unsigned int, sbitmap,
00848 edge, edge *,
00849 unsigned int *, int);
00850 struct loop *tree_ssa_loop_version (struct loops *, struct loop *, tree,
00851 basic_block *);
00852 tree expand_simple_operations (tree);
00853 void substitute_in_loop_info (struct loop *, tree, tree);
00854 edge single_dom_exit (struct loop *);
00855 bool can_unroll_loop_p (struct loop *loop, unsigned factor,
00856 struct tree_niter_desc *niter);
00857 void tree_unroll_loop (struct loops *, struct loop *, unsigned,
00858 edge, struct tree_niter_desc *);
00859 bool contains_abnormal_ssa_name_p (tree);
00860
00861 /* In tree-ssa-threadedge.c */
00862 extern bool potentially_threadable_block (basic_block);
00863 extern void thread_across_edge (tree, edge, bool,
00864 VEC(tree, heap) **, tree (*) (tree, tree));
00865
00866 /* In tree-ssa-loop-im.c */
00867 /* The possibilities of statement movement. */
00868
00869 enum move_pos
00870 {
00871 MOVE_IMPOSSIBLE, /* No movement -- side effect expression. */
00872 MOVE_PRESERVE_EXECUTION, /* Must not cause the non-executed statement
00873 become executed -- memory accesses, ... */
00874 MOVE_POSSIBLE /* Unlimited movement. */
00875 };
00876 extern enum move_pos movement_possibility (tree);
00877
00878 /* The reasons a variable may escape a function. */
00879 enum escape_type
00880 {
00881 NO_ESCAPE = 0, /* Doesn't escape. */
00882 ESCAPE_STORED_IN_GLOBAL = 1 << 1,
00883 ESCAPE_TO_ASM = 1 << 2, /* Passed by address to an assembly
00884 statement. */
00885 ESCAPE_TO_CALL = 1 << 3, /* Escapes to a function call. */
00886 ESCAPE_BAD_CAST = 1 << 4, /* Cast from pointer to integer */
00887 ESCAPE_TO_RETURN = 1 << 5, /* Returned from function. */
00888 ESCAPE_TO_PURE_CONST = 1 << 6, /* Escapes to a pure or constant
00889 function call. */
00890 ESCAPE_IS_GLOBAL = 1 << 7, /* Is a global variable. */
00891 ESCAPE_IS_PARM = 1 << 8, /* Is an incoming function parameter. */
00892 ESCAPE_UNKNOWN = 1 << 9 /* We believe it escapes for some reason
00893 not enumerated above. */
00894 };
00895
00896 /* In tree-flow-inline.h */
00897 static inline bool is_call_clobbered (tree);
00898 static inline void mark_call_clobbered (tree, unsigned int);
00899 static inline void set_is_used (tree);
00900 static inline bool unmodifiable_var_p (tree);
00901
00902 /* In tree-eh.c */
00903 extern void make_eh_edges (tree);
00904 extern bool tree_could_trap_p (tree);
00905 extern bool tree_could_throw_p (tree);
00906 extern bool tree_can_throw_internal (tree);
00907 extern bool tree_can_throw_external (tree);
00908 extern int lookup_stmt_eh_region (tree);
00909 extern void add_stmt_to_eh_region (tree, int);
00910 extern bool remove_stmt_from_eh_region (tree);
00911 extern bool maybe_clean_or_replace_eh_stmt (tree, tree);
00912
00913 /* In tree-ssa-pre.c */
00914 void add_to_value (tree, tree);
00915 void debug_value_expressions (tree);
00916 void print_value_expressions (FILE *, tree);
00917
00918
00919 /* In tree-vn.c */
00920 bool expressions_equal_p (tree, tree);
00921 tree get_value_handle (tree);
00922 hashval_t vn_compute (tree, hashval_t);
00923 void sort_vuses (VEC (tree, gc) *);
00924 tree vn_lookup_or_add (tree, tree);
00925 tree vn_lookup_or_add_with_vuses (tree, VEC (tree, gc) *);
00926 void vn_add (tree, tree);
00927 void vn_add_with_vuses (tree, tree, VEC (tree, gc) *);
00928 tree vn_lookup (tree, tree);
00929 tree vn_lookup_with_vuses (tree, VEC (tree, gc) *);
00930 void vn_init (void);
00931 void vn_delete (void);
00932
00933 /* In tree-ssa-sink.c */
00934 bool is_hidden_global_store (tree);
00935
00936 /* In tree-sra.c */
00937 void insert_edge_copies (tree, basic_block);
00938 void sra_insert_before (block_stmt_iterator *, tree);
00939 void sra_insert_after (block_stmt_iterator *, tree);
00940 void sra_init_cache (void);
00941 bool sra_type_can_be_decomposed_p (tree);
00942
00943 /* In tree-loop-linear.c */
00944 extern void linear_transform_loops (struct loops *);
00945
00946 /* In tree-ssa-loop-ivopts.c */
00947 bool expr_invariant_in_loop_p (struct loop *, tree);
00948 bool multiplier_allowed_in_address_p (HOST_WIDE_INT);
00949 unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode);
00950
00951 /* In tree-ssa-threadupdate.c. */
00952 extern bool thread_through_all_blocks (void);
00953 extern void register_jump_thread (edge, edge);
00954
00955 /* In gimplify.c */
00956 tree force_gimple_operand (tree, tree *, bool, tree);
00957 tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree);
00958
00959 /* In tree-ssa-structalias.c */
00960 bool find_what_p_points_to (tree);
00961
00962 /* In tree-ssa-live.c */
00963 extern void remove_unused_locals (void);
00964
00965 /* In tree-ssa-address.c */
00966
00967 /* Affine combination of trees. We keep track of at most MAX_AFF_ELTS elements
00968 to make things simpler; this is sufficient in most cases. */
00969
00970 #define MAX_AFF_ELTS 8
00971
00972 struct affine_tree_combination
00973 {
00974 /* Type of the result of the combination. */
00975 tree type;
00976
00977 /* Mask modulo that the operations are performed. */
00978 unsigned HOST_WIDE_INT mask;
00979
00980 /* Constant offset. */
00981 unsigned HOST_WIDE_INT offset;
00982
00983 /* Number of elements of the combination. */
00984 unsigned n;
00985
00986 /* Elements and their coefficients. */
00987 tree elts[MAX_AFF_ELTS];
00988 unsigned HOST_WIDE_INT coefs[MAX_AFF_ELTS];
00989
00990 /* Remainder of the expression. */
00991 tree rest;
00992 };
00993
00994 /* Description of a memory address. */
00995
00996 struct mem_address
00997 {
00998 tree symbol, base, index, step, offset;
00999 };
01000
01001 tree create_mem_ref (block_stmt_iterator *, tree,
01002 struct affine_tree_combination *);
01003 rtx addr_for_mem_ref (struct mem_address *, bool);
01004 void get_address_description (tree, struct mem_address *);
01005 tree maybe_fold_tmr (tree);
01006
01007 /* This structure is simply used during pushing fields onto the fieldstack
01008 to track the offset of the field, since bitpos_of_field gives it relative
01009 to its immediate containing type, and we want it relative to the ultimate
01010 containing object. */
01011
01012 struct fieldoff
01013 {
01014 tree type;
01015 tree size;
01016 tree decl;
01017 HOST_WIDE_INT offset;
01018 };
01019 typedef struct fieldoff fieldoff_s;
01020
01021 DEF_VEC_O(fieldoff_s);
01022 DEF_VEC_ALLOC_O(fieldoff_s,heap);
01023 int push_fields_onto_fieldstack (tree, VEC(fieldoff_s,heap) **,
01024 HOST_WIDE_INT, bool *);
01025 void sort_fieldstack (VEC(fieldoff_s,heap) *);
01026
01027 void init_alias_heapvars (void);
01028 void delete_alias_heapvars (void);
01029
01030 #include "tree-flow-inline.h"
01031
01032 void swap_tree_operands (tree, tree *, tree *);
01033
01034 extern void recalculate_used_alone (void);
01035 extern bool updating_used_alone;
01036 #endif /* _TREE_FLOW_H */