diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-10-05 18:58:36 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-10-05 18:58:36 +0000 |
commit | 2abacef0911d96bf1641a8cbe9da514b9d88c7d3 (patch) | |
tree | 3e5b1aa4e61d5ee76743409819cb15a5d0ab73fe | |
parent | 09fa81dbb7a6c892b01bac7e8193316fd1428d36 (diff) | |
download | gcc-2abacef0911d96bf1641a8cbe9da514b9d88c7d3.zip gcc-2abacef0911d96bf1641a8cbe9da514b9d88c7d3.tar.gz gcc-2abacef0911d96bf1641a8cbe9da514b9d88c7d3.tar.bz2 |
tree-cfg.c (thread_jumps): Iterate with FOR_EACH_BB instead of FOR_BB_BETWEEN.
* tree-cfg.c (thread_jumps): Iterate with FOR_EACH_BB instead
of FOR_BB_BETWEEN. Remove a useless check for unreachable
blocks.
From-SVN: r88566
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 16 |
2 files changed, 14 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7ef42ea..d578219 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2004-10-05 Kazu Hirata <kazu@cs.umass.edu> + * tree-cfg.c (thread_jumps): Iterate with FOR_EACH_BB instead + of FOR_BB_BETWEEN. Remove a useless check for unreachable + blocks. + +2004-10-05 Kazu Hirata <kazu@cs.umass.edu> + * tree-cfg.c (cleanup_tree_cfg): Don't call delete_unreachable_blosk() after thread_jumps(). (thread_jumps): Always remove basic blocks as they become diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index afeb4de..2eff754 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3825,7 +3825,11 @@ tree_forwarder_block_p (basic_block bb) /* Thread jumps over empty statements. This code should _not_ thread over obviously equivalent conditions - as that requires nontrivial updates to the SSA graph. */ + as that requires nontrivial updates to the SSA graph. + + As a precondition, we require that all basic blocks be reachable. + That is, there should be no opportunities left for + delete_unreachable_blocks. */ static bool thread_jumps (void) @@ -3839,18 +3843,14 @@ thread_jumps (void) FOR_EACH_BB (bb) bb_ann (bb)->forwardable = 1; - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) + FOR_EACH_BB (bb) { edge_iterator ei; - /* Don't waste time on unreachable blocks. */ - if (EDGE_COUNT (bb->preds) == 0) - continue; - - /* Nor on forwarders. */ + /* Don't waste time on forwarders. */ if (tree_forwarder_block_p (bb)) continue; - + /* This block is now part of a forwarding path, mark it as not forwardable so that we can detect loops. This bit will be reset below. */ |