diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-03 19:10:44 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-03 19:10:44 +0000 |
commit | 3f9439d71f45a5eb2d699fb5b6d819143031b5db (patch) | |
tree | 00a98b1b54819809ffb6999717d9263ac5558fe2 /gcc/cfgloopmanip.c | |
parent | 604c77da256415c139a223b79136b93b64e5d2c5 (diff) | |
download | gcc-3f9439d71f45a5eb2d699fb5b6d819143031b5db.tar.gz |
* cfgloopmanip.c (remove_path, loopify, duplicate_loop_to_header_edge):
Change dom_bbs to vector. Add argument to iterate_fix_dominators call.
* loop-unroll.c (unroll_loop_runtime_iterations): Ditto.
* tree-cfg.c (tree_duplicate_sese_region): Change doms to vector.
Add argument to iterate_fix_dominators call.
(remove_edge_and_dominated_blocks): Pass vector to bbs_to_fix_dom.
* gcse.c (hoist_code): Change domby to vector.
* cfghooks.c (make_forwarder_block): Change doms_to_fix to vector.
Add argument to iterate_fix_dominators call.
* loop-doloop.c (doloop_modify): Changed recount_dominator to
recompute_dominator.
* lambda-code.c (perfect_nestify): Ditto.
* cfgloopanal.c: Include graphds.h.
(struct edge, struct vertex, struct graph, dump_graph, new_graph,
add_edge, dfs, for_each_edge, free_graph): Moved to graphds.c.
(mark_irreducible_loops): Use graphds_scc. Remove argument from
add_edge call.
* graphds.c: New file.
* graphds.h: New file.
* dominance.c: Include vecprim.h, pointer-set.h and graphds.h.
(get_dominated_by, get_dominated_by_region): Change return type to
vector.
(verify_dominators): Recompute all dominators and compare the results.
(recount_dominator): Renamed to ...
(recompute_dominator): ... this. Do not check that the block is
dominated by entry.
(iterate_fix_dominators): Reimplemented.
(prune_bbs_to_update_dominators, root_of_dom_tree,
determine_dominators_for_sons): New functions.
* et-forest.c (et_root): New function.
* et-forest.h (et_root): Declare.
* Makefile.in (graphds.o): Add.
(cfgloopanal.o): Add graphds.h dependency.
(dominance.o): Add graphds.h, vecprim.h and pointer-set.h dependency.
* basic-block.h (get_dominated_by, get_dominated_by_region,
iterate_fix_dominators): Declaration changed.
(recount_dominator): Renamed to ...
(recompute_dominator): ... this.
* tree-ssa-threadupdate.c (thread_block): Free dominance info.
(thread_through_all_blocks): Do not free dominance info.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125297 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloopmanip.c')
-rw-r--r-- | gcc/cfgloopmanip.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index 99b41d7ceae..4568833065b 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -276,8 +276,9 @@ bool remove_path (edge e) { edge ae; - basic_block *rem_bbs, *bord_bbs, *dom_bbs, from, bb; - int i, nrem, n_bord_bbs, n_dom_bbs, nreml; + basic_block *rem_bbs, *bord_bbs, from, bb; + VEC (basic_block, heap) *dom_bbs; + int i, nrem, n_bord_bbs, nreml; sbitmap seen; bool irred_invalidated = false; struct loop **deleted_loop; @@ -338,7 +339,7 @@ remove_path (edge e) /* Remove the path. */ from = e->src; remove_branch (e); - dom_bbs = XCNEWVEC (basic_block, n_basic_blocks); + dom_bbs = NULL; /* Cancel loops contained in the path. */ deleted_loop = XNEWVEC (struct loop *, nrem); @@ -355,7 +356,6 @@ remove_path (edge e) free (deleted_loop); /* Find blocks whose dominators may be affected. */ - n_dom_bbs = 0; sbitmap_zero (seen); for (i = 0; i < n_bord_bbs; i++) { @@ -370,14 +370,14 @@ remove_path (edge e) ldom; ldom = next_dom_son (CDI_DOMINATORS, ldom)) if (!dominated_by_p (CDI_DOMINATORS, from, ldom)) - dom_bbs[n_dom_bbs++] = ldom; + VEC_safe_push (basic_block, heap, dom_bbs, ldom); } free (seen); /* Recount dominators. */ - iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs); - free (dom_bbs); + iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, true); + VEC_free (basic_block, heap, dom_bbs); free (bord_bbs); /* Fix placements of basic blocks inside loops and the placement of @@ -472,8 +472,9 @@ loopify (edge latch_edge, edge header_edge, { basic_block succ_bb = latch_edge->dest; basic_block pred_bb = header_edge->src; - basic_block *dom_bbs, *body; - unsigned n_dom_bbs, i; + basic_block *body; + VEC (basic_block, heap) *dom_bbs; + unsigned i; sbitmap seen; struct loop *loop = alloc_loop (); struct loop *outer = loop_outer (succ_bb->loop_father); @@ -528,8 +529,7 @@ loopify (edge latch_edge, edge header_edge, scale_loop_frequencies (succ_bb->loop_father, true_scale, REG_BR_PROB_BASE); /* Update dominators of blocks outside of LOOP. */ - dom_bbs = XCNEWVEC (basic_block, n_basic_blocks); - n_dom_bbs = 0; + dom_bbs = NULL; seen = sbitmap_alloc (last_basic_block); sbitmap_zero (seen); body = get_loop_body (loop); @@ -547,15 +547,15 @@ loopify (edge latch_edge, edge header_edge, if (!TEST_BIT (seen, ldom->index)) { SET_BIT (seen, ldom->index); - dom_bbs[n_dom_bbs++] = ldom; + VEC_safe_push (basic_block, heap, dom_bbs, ldom); } } - iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs); + iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false); free (body); free (seen); - free (dom_bbs); + VEC_free (basic_block, heap, dom_bbs); return loop; } @@ -1054,23 +1054,23 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, /* Update dominators of outer blocks if affected. */ for (i = 0; i < n; i++) { - basic_block dominated, dom_bb, *dom_bbs; - int n_dom_bbs,j; + basic_block dominated, dom_bb; + VEC (basic_block, heap) *dom_bbs; + unsigned j; bb = bbs[i]; bb->aux = 0; - n_dom_bbs = get_dominated_by (CDI_DOMINATORS, bb, &dom_bbs); - for (j = 0; j < n_dom_bbs; j++) + dom_bbs = get_dominated_by (CDI_DOMINATORS, bb); + for (j = 0; VEC_iterate (basic_block, dom_bbs, j, dominated); j++) { - dominated = dom_bbs[j]; if (flow_bb_inside_loop_p (loop, dominated)) continue; dom_bb = nearest_common_dominator ( CDI_DOMINATORS, first_active[i], first_active_latch); set_immediate_dominator (CDI_DOMINATORS, dominated, dom_bb); } - free (dom_bbs); + VEC_free (basic_block, heap, dom_bbs); } free (first_active); |