aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-10-02 02:00:51 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-10-02 02:00:51 +0000
commit26d4492f61622491f615cbc065f9186b683e76b3 (patch)
tree0f8b589bb3ccfc6ed5ffc6065e2bed0cf1b544e1
parentee0f32f4ac63a937f0819e8d1caaf128e01cdf1e (diff)
downloadgcc-26d4492f61622491f615cbc065f9186b683e76b3.zip
gcc-26d4492f61622491f615cbc065f9186b683e76b3.tar.gz
gcc-26d4492f61622491f615cbc065f9186b683e76b3.tar.bz2
tree-cfg.c (cleanup_tree_cfg): Speed up by calling delete_unrechable_blocks() only when necessary.
* tree-cfg.c (cleanup_tree_cfg): Speed up by calling delete_unrechable_blocks() only when necessary. From-SVN: r88419
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-cfg.c20
2 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 24a1034..9dbb7fe 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * tree-cfg.c (cleanup_tree_cfg): Speed up by calling
+ delete_unrechable_blocks() only when necessary.
+
2004-10-02 P.J. Darcy <darcypj@us.ibm.com>
* gthr-tpf.h (__gthread_recursive_mutex_t): New type.
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index e047943..6919fac 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -718,19 +718,29 @@ cleanup_tree_cfg (void)
timevar_push (TV_TREE_CLEANUP_CFG);
retval = cleanup_control_flow ();
+ retval |= delete_unreachable_blocks ();
- /* These two transformations can cascade, so we iterate on them until
- nothing changes. */
+ /* thread_jumps() sometimes leaves further transformation
+ opportunities for itself, so iterate on it until nothing
+ changes. */
while (something_changed)
{
- something_changed = delete_unreachable_blocks ();
- something_changed |= thread_jumps ();
+ something_changed = thread_jumps ();
+
+ /* delete_unreachable_blocks() does its job only when
+ thread_jumps() produces more unreachable blocks. */
+ if (something_changed)
+ delete_unreachable_blocks ();
+
retval |= something_changed;
}
#ifdef ENABLE_CHECKING
if (retval)
- gcc_assert (!cleanup_control_flow ());
+ {
+ gcc_assert (!cleanup_control_flow ());
+ gcc_assert (!delete_unreachable_blocks ());
+ }
#endif
/* Merging the blocks creates no new opportunities for the other