summaryrefslogtreecommitdiff
path: root/gcc/cfgloop.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-20 17:51:06 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-20 17:51:06 +0000
commit89d75d78ea20e6326fb171c82a5b61ca98694329 (patch)
tree8635e8934338aabce3b83e28ee4e39d8b3df5645 /gcc/cfgloop.c
parent0480d7803b3e4ea45f51343c7720c0f5589814e5 (diff)
downloadgcc-89d75d78ea20e6326fb171c82a5b61ca98694329.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54843 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloop.c')
-rw-r--r--gcc/cfgloop.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index e5cc41b4131..09a1fb24a1e 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -36,7 +36,7 @@ static void flow_loop_exit_edges_find PARAMS ((struct loop *));
static int flow_loop_nodes_find PARAMS ((basic_block, struct loop *));
static void flow_loop_pre_header_scan PARAMS ((struct loop *));
static basic_block flow_loop_pre_header_find PARAMS ((basic_block,
- const sbitmap *));
+ dominance_info));
static int flow_loop_level_compute PARAMS ((struct loop *));
static int flow_loops_level_compute PARAMS ((struct loops *));
static basic_block make_forwarder_block PARAMS ((basic_block, int, int,
@@ -224,7 +224,7 @@ flow_loops_free (loops)
loops->parray = NULL;
if (loops->cfg.dom)
- sbitmap_vector_free (loops->cfg.dom);
+ free_dominance_info (loops->cfg.dom);
if (loops->cfg.dfs_order)
free (loops->cfg.dfs_order);
@@ -415,7 +415,7 @@ flow_loop_pre_header_scan (loop)
static basic_block
flow_loop_pre_header_find (header, dom)
basic_block header;
- const sbitmap *dom;
+ dominance_info dom;
{
basic_block pre_header;
edge e;
@@ -428,7 +428,7 @@ flow_loop_pre_header_find (header, dom)
basic_block node = e->src;
if (node != ENTRY_BLOCK_PTR
- && ! TEST_BIT (dom[node->index], header->index))
+ && ! dominated_by_p (dom, node, header))
{
if (pre_header == NULL)
pre_header = node;
@@ -645,13 +645,12 @@ make_forwarder_block (bb, redirect_latch, redirect_nonlatch, except,
static void
canonicalize_loop_headers ()
{
- sbitmap *dom;
+ dominance_info dom;
basic_block header;
edge e;
/* Compute the dominators. */
- dom = sbitmap_vector_alloc (last_basic_block, last_basic_block);
- calculate_dominance_info (NULL, dom, CDI_DOMINATORS);
+ dom = calculate_dominance_info (CDI_DOMINATORS);
alloc_aux_for_blocks (sizeof (int));
alloc_aux_for_edges (sizeof (int));
@@ -670,7 +669,7 @@ canonicalize_loop_headers ()
have_abnormal_edge = 1;
if (latch != ENTRY_BLOCK_PTR
- && TEST_BIT (dom[latch->index], header->index))
+ && dominated_by_p (dom, latch, header))
{
num_latches++;
LATCH_EDGE (e) = 1;
@@ -747,7 +746,7 @@ canonicalize_loop_headers ()
free_aux_for_blocks ();
free_aux_for_edges ();
- sbitmap_vector_free (dom);
+ free_dominance_info (dom);
}
/* Find all the natural loops in the function and save in LOOPS structure and
@@ -765,10 +764,11 @@ flow_loops_find (loops, flags)
int num_loops;
edge e;
sbitmap headers;
- sbitmap *dom;
+ dominance_info dom;
int *dfs_order;
int *rc_order;
- basic_block header, bb;
+ basic_block header;
+ basic_block bb;
/* This function cannot be repeatedly called with different
flags to build up the loop information. The loop tree
@@ -790,8 +790,7 @@ flow_loops_find (loops, flags)
canonicalize_loop_headers ();
/* Compute the dominators. */
- loops->cfg.dom = dom = sbitmap_vector_alloc (last_basic_block, last_basic_block);
- calculate_dominance_info (NULL, dom, CDI_DOMINATORS);
+ dom = loops->cfg.dom = calculate_dominance_info (CDI_DOMINATORS);
/* Count the number of loop headers. This should be the
same as the number of natural loops. */
@@ -824,8 +823,7 @@ flow_loops_find (loops, flags)
node (header) that dominates all the nodes in the
loop. It also has single back edge to the header
from a latch node. */
- if (latch != ENTRY_BLOCK_PTR && TEST_BIT (dom[latch->index],
- header->index))
+ if (latch != ENTRY_BLOCK_PTR && dominated_by_p (dom, latch, header))
{
/* Shared headers should be eliminated by now. */
if (more_latches)
@@ -899,7 +897,7 @@ flow_loops_find (loops, flags)
basic_block latch = e->src;
if (latch != ENTRY_BLOCK_PTR
- && TEST_BIT (dom[latch->index], header->index))
+ && dominated_by_p (dom, latch, header))
{
loop->latch = latch;
break;
@@ -925,7 +923,7 @@ flow_loops_find (loops, flags)
else
{
loops->cfg.dom = NULL;
- sbitmap_vector_free (dom);
+ free_dominance_info (dom);
}
#ifdef ENABLE_CHECKING
verify_flow_info ();