diff options
author | Zdenek Dvorak <dvorakz@suse.cz> | 2007-06-03 21:10:44 +0200 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2007-06-03 19:10:44 +0000 |
commit | 66f97d31f233e10870728947731db603b5dc0c9c (patch) | |
tree | 00a98b1b54819809ffb6999717d9263ac5558fe2 /gcc/loop-unroll.c | |
parent | b6a9c30c80a0713b0b27f434dfe34b0552fc7384 (diff) | |
download | gcc-66f97d31f233e10870728947731db603b5dc0c9c.zip gcc-66f97d31f233e10870728947731db603b5dc0c9c.tar.gz gcc-66f97d31f233e10870728947731db603b5dc0c9c.tar.bz2 |
cfgloopmanip.c (remove_path, [...]): Change dom_bbs to vector.
* 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.
From-SVN: r125297
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r-- | gcc/loop-unroll.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index c5653b2..77d454f 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -953,8 +953,8 @@ unroll_loop_runtime_iterations (struct loop *loop) { rtx old_niter, niter, init_code, branch_code, tmp; unsigned i, j, p; - basic_block preheader, *body, *dom_bbs, swtch, ezc_swtch; - unsigned n_dom_bbs; + basic_block preheader, *body, swtch, ezc_swtch; + VEC (basic_block, heap) *dom_bbs; sbitmap wont_exit; int may_exit_copy; unsigned n_peel; @@ -972,21 +972,20 @@ unroll_loop_runtime_iterations (struct loop *loop) opt_info = analyze_insns_in_loop (loop); /* Remember blocks whose dominators will have to be updated. */ - dom_bbs = XCNEWVEC (basic_block, n_basic_blocks); - n_dom_bbs = 0; + dom_bbs = NULL; body = get_loop_body (loop); for (i = 0; i < loop->num_nodes; i++) { - unsigned nldom; - basic_block *ldom; + VEC (basic_block, heap) *ldom; + basic_block bb; - nldom = get_dominated_by (CDI_DOMINATORS, body[i], &ldom); - for (j = 0; j < nldom; j++) - if (!flow_bb_inside_loop_p (loop, ldom[j])) - dom_bbs[n_dom_bbs++] = ldom[j]; + ldom = get_dominated_by (CDI_DOMINATORS, body[i]); + for (j = 0; VEC_iterate (basic_block, ldom, j, bb); j++) + if (!flow_bb_inside_loop_p (loop, bb)) + VEC_safe_push (basic_block, heap, dom_bbs, bb); - free (ldom); + VEC_free (basic_block, heap, ldom); } free (body); @@ -1105,7 +1104,7 @@ unroll_loop_runtime_iterations (struct loop *loop) } /* Recount dominators for outer blocks. */ - iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs); + iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false); /* And unroll loop. */ @@ -1177,8 +1176,7 @@ unroll_loop_runtime_iterations (struct loop *loop) "in runtime, %i insns\n", max_unroll, num_loop_insns (loop)); - if (dom_bbs) - free (dom_bbs); + VEC_free (basic_block, heap, dom_bbs); } /* Decide whether to simply peel LOOP and how much. */ |