aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-11-23 19:34:35 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-11-23 19:34:35 +0000
commit07b43a87c0a558c3b840da1ed9ba530eef710309 (patch)
tree55f653628fc5b253fce0fd791902fdb5edfba255
parent6b66c71882bde3e130b6fca319ea6a1a3a964d06 (diff)
downloadgcc-07b43a87c0a558c3b840da1ed9ba530eef710309.zip
gcc-07b43a87c0a558c3b840da1ed9ba530eef710309.tar.gz
gcc-07b43a87c0a558c3b840da1ed9ba530eef710309.tar.bz2
tree-cfg.c (tree_try_redirect_by_replacing_jump): Speed up by restricting to the case with two outgoing edges.
* tree-cfg.c (tree_try_redirect_by_replacing_jump): Speed up by restricting to the case with two outgoing edges. From-SVN: r91098
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/tree-cfg.c14
2 files changed, 9 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2fa744f..f809b27 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -15,6 +15,9 @@
* tree.h (PHI_ARG_EDGE): Redefine in terms of EDGE_PRED.
(phi_arg_d): Remove e.
+ * tree-cfg.c (tree_try_redirect_by_replacing_jump): Speed up
+ by restricting to the case with two outgoing edges.
+
2004-11-23 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.c (s390_backchain_string): Removed.
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 1f934cb..b59c8f7 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4247,17 +4247,15 @@ static edge
tree_try_redirect_by_replacing_jump (edge e, basic_block target)
{
basic_block src = e->src;
- edge tmp;
block_stmt_iterator b;
tree stmt;
- edge_iterator ei;
-
- /* Verify that all targets will be TARGET. */
- FOR_EACH_EDGE (tmp, ei, src->succs)
- if (tmp->dest != target && tmp != e)
- break;
- if (tmp)
+ /* We can replace or remove a complex jump only when we have exactly
+ two edges. */
+ if (EDGE_COUNT (src->succs) != 2
+ /* Verify that all targets will be TARGET. Specifically, the
+ edge that is not E must also go to TARGET. */
+ || EDGE_SUCC (src, EDGE_SUCC (src, 0) == e)->dest != target)
return NULL;
b = bsi_last (src);