diff options
author | Jan Hubicka <jh@suse.cz> | 2002-06-20 19:51:06 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2002-06-20 17:51:06 +0000 |
commit | 355be0dc5824199cd14e8ee57983332ae2b26226 (patch) | |
tree | 8635e8934338aabce3b83e28ee4e39d8b3df5645 /gcc/ifcvt.c | |
parent | 62c71f4bc29a578f50b161f20fb5f56826f4f019 (diff) | |
download | gcc-355be0dc5824199cd14e8ee57983332ae2b26226.zip gcc-355be0dc5824199cd14e8ee57983332ae2b26226.tar.gz gcc-355be0dc5824199cd14e8ee57983332ae2b26226.tar.bz2 |
Mon Jun 10 20:42:34 CEST 2002 Jan Hubicka <jh@suse.cz>
* basic-block.h: Do not include et-forest.h
(dominance_info): Declare as struct dominance-info.
* cfglayout.c (cleanup_unconditional_jumps): Remove the edge before
deleting block.
* dominance.c (struct dominance_info): Define.
(BB_NODE, SET_BB_NODE): New macros.
(bb_hash_func, bb_eq_func): Kill.
(calculate_dominace_info, free_dominacne_info, set_immediate_dominator,
nearest_common_dominator, dominated_by_p, recount_dominator,
add_to_dominance_info, delete_from_dominance_info): update for new
representation.
(get_dominated_by, redirect_immediate_dominators): Rewrite using
enumerate_sons.
* ifcvt.c (process_double_test_block, merge_if_block, find_cond_trap,
find_if_case_1, find_if_case_2): Remove killed blocks from dominance
structure.
* et-forest.h: Update copyright; revamp all function to operate on
nodes
(et_forest_value): Kill.
(et_forest_enumerate_sons, et_forest_node_value): New.
* et-forest.c: Update copyright.
* et-forest.h: Update copyright; revamp all function to operate on
nodes
(et_forest_value): Kill.
(et_forest_enumerate_sons, et_forest_node_value): New.
Thu Jun 6 22:43:43 CEST 2002 Jan Hubicka <jh@suse.cz>
* basic-block.h: Inlude et-forest.h
(basic_block_def): Kill dominator.
(dominance_info): New type.
(loops): Use dominace_info.
(dominace handling functions): Take dominace_info as argument
instead of bitmaps.
(create_preheader): Likewise.
* cfg.c (entry_exit_blocks): Kill dominator.
(dump_flow_info): Do not dump dominators.
* cfglayout.c (cleanup_unconditonal_jumps): Delete deleted block from
dominators.
* cfgloop.c (flow_pre_header_find): Use dominacne_info.
(flow_loops_pre_header_scan, make_forwarder_block,
canonicale_loop_headers, flow_loops_find): Likewise.
* dominance.c: Include error.h
(idoms_to_doms): Kill.
(bb_hash_func, bb_eq_func): New static functions.
(debug_dominace_info): New global function.
(calculate_dominance_info): Use new et forest structure.
(free_dominace_info, get_immediate_dominator, set_immediate_dominator,
get_dominated_by, redirect_immediate_dominators,
nearest_common_dominator, dominated_by_p, verify_dominators,
recount_dominator, iterate_fix_dominators, add_to_dominace_info,
delete_from_dominance_info): New global functions.
* gcse.c (domnators): CHange to dominance_info.
(alloc_hoist_mem): Do not alloc dominators
(free_code_hoist_mem): Use free_dominance_info.
(compute_code_hoist_data): Use dominance_info.
(hoist_code): Likewise.
* ifcvt.c (post_dominators): Likewise.
(find_if_case_2, if_convert): Likewise.
* predict.c (process_note_predictions, process_note_prediction,
estimate-probability): Likewise.
* sched-rgn.c (find_rgns, init_regions): Likewise.
* ssa-dce.c (find_all_control_dependences, fint_control_depemndence,
find_pdom, delete_insn_bb, ssa_eliminate_dead_code): Likewise.
* ssa.c (compute_dominance_frontiers_1, rename_block, rename_registers,
find_evaluations, convert_to_ssa): Likewise.
* ssa.h (compute_dominance_frontiers): Likewise.
Thu Jun 6 22:57:34 CEST 2002 Pavel Nejedly <bim@atrey.karlin.mff.cuni.cz>
* Makefile.in (et-forest.c): Add.
* et-forest.c: New file.
* at-forest.h: New file.
Co-Authored-By: Pavel Nejedly <bim@atrey.karlin.mff.cuni.cz>
From-SVN: r54843
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r-- | gcc/ifcvt.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index bd9d7da..6bc522d 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -77,7 +77,7 @@ static int num_removed_blocks; static bool life_data_ok; /* The post-dominator relation on the original block numbers. */ -static sbitmap *post_dominators; +static dominance_info post_dominators; /* Forward references. */ static int count_bb_insns PARAMS ((basic_block)); @@ -1814,6 +1814,8 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb) if (combo_bb->global_live_at_end) COPY_REG_SET (combo_bb->global_live_at_end, then_bb->global_live_at_end); + if (post_dominators) + delete_from_dominance_info (post_dominators, then_bb); merge_blocks_nomove (combo_bb, then_bb); num_removed_blocks++; } @@ -1823,6 +1825,8 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb) get their addresses taken. */ if (else_bb) { + if (post_dominators) + delete_from_dominance_info (post_dominators, else_bb); merge_blocks_nomove (combo_bb, else_bb); num_removed_blocks++; } @@ -1877,6 +1881,8 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb) if (combo_bb->global_live_at_end) COPY_REG_SET (combo_bb->global_live_at_end, join_bb->global_live_at_end); + if (post_dominators) + delete_from_dominance_info (post_dominators, join_bb); merge_blocks_nomove (combo_bb, join_bb); num_removed_blocks++; } @@ -2135,6 +2141,8 @@ find_cond_trap (test_bb, then_edge, else_edge) remove_edge (trap_bb == then_bb ? then_edge : else_edge); if (trap_bb->pred == NULL) { + if (post_dominators) + delete_from_dominance_info (post_dominators, trap_bb); flow_delete_block (trap_bb); num_removed_blocks++; } @@ -2316,6 +2324,8 @@ find_if_case_1 (test_bb, then_edge, else_edge) new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb); then_bb_index = then_bb->index; + if (post_dominators) + delete_from_dominance_info (post_dominators, then_bb); flow_delete_block (then_bb); /* Make rest of code believe that the newly created block is the THEN_BB block we removed. */ @@ -2366,8 +2376,8 @@ find_if_case_2 (test_bb, then_edge, else_edge) if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2) ; else if (else_succ->dest->index < 0 - || TEST_BIT (post_dominators[then_bb->index], - else_succ->dest->index)) + || dominated_by_p (post_dominators, then_bb, + else_succ->dest)) ; else return FALSE; @@ -2393,6 +2403,8 @@ find_if_case_2 (test_bb, then_edge, else_edge) then_bb->global_live_at_start, else_bb->global_live_at_end, BITMAP_IOR); + if (post_dominators) + delete_from_dominance_info (post_dominators, else_bb); flow_delete_block (else_bb); num_removed_blocks++; @@ -2700,8 +2712,7 @@ if_convert (x_life_data_ok) post_dominators = NULL; if (HAVE_conditional_execution || life_data_ok) { - post_dominators = sbitmap_vector_alloc (last_basic_block, last_basic_block); - calculate_dominance_info (NULL, post_dominators, CDI_POST_DOMINATORS); + post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS); } if (life_data_ok) clear_bb_flags (); @@ -2712,7 +2723,7 @@ if_convert (x_life_data_ok) continue; if (post_dominators) - sbitmap_vector_free (post_dominators); + free_dominance_info (post_dominators); if (rtl_dump_file) fflush (rtl_dump_file); |