diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-11-29 17:56:19 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-11-29 17:56:19 +0000 |
commit | 03101c6f2b4ce8f254b707b709183a08ef41de1f (patch) | |
tree | 13792550dcad7fea8744ca68de3f87d9b9e8af6c /gcc/cfgrtl.c | |
parent | 62112e35c6368eeb4fe5192d9240958e4c477287 (diff) | |
download | gcc-03101c6f2b4ce8f254b707b709183a08ef41de1f.zip gcc-03101c6f2b4ce8f254b707b709183a08ef41de1f.tar.gz gcc-03101c6f2b4ce8f254b707b709183a08ef41de1f.tar.bz2 |
cfgrtl.c (cfg_layout_redirect_edge_and_branch): Speed up by simplifying edge manipulation.
* cfgrtl.c (cfg_layout_redirect_edge_and_branch): Speed up by
simplifying edge manipulation.
From-SVN: r91474
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 3ba3265..818c5b8 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -2587,25 +2587,8 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest) of conditional jump, remove it. */ if (EDGE_COUNT (src->succs) == 2) { - bool found = false; - unsigned ix = 0; - edge tmp, s; - edge_iterator ei; - - FOR_EACH_EDGE (tmp, ei, src->succs) - if (e == tmp) - { - found = true; - ix = ei.index; - break; - } - - gcc_assert (found); - - if (EDGE_COUNT (src->succs) > (ix + 1)) - s = EDGE_SUCC (src, ix + 1); - else - s = EDGE_SUCC (src, 0); + /* Find the edge that is different from E. */ + edge s = EDGE_SUCC (src, EDGE_SUCC (src, 0) == e); if (s->dest == dest && any_condjump_p (BB_END (src)) |