tree-cfg.c (tree_forwarder_block_p): Speed up by walking through the statements backward.
authorKazu Hirata <kazu@cs.umass.edu>
Mon, 17 Jan 2005 18:44:18 +0000 (18:44 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 17 Jan 2005 18:44:18 +0000 (18:44 +0000)
* tree-cfg.c (tree_forwarder_block_p): Speed up by walking
through the statements backward.

From-SVN: r93768

gcc/ChangeLog
gcc/tree-cfg.c

index e6777c8e0170b11b885db5b34828b2fb1bf93dbb..fa24164f01934ca4b80e3b3c3628a11742a9a026 100644 (file)
@@ -2,6 +2,9 @@
 
        * tree-cfg.c (tree_can_merge_blocks_p): Reorder two checks.
 
+       * tree-cfg.c (tree_forwarder_block_p): Speed up by walking
+       through the statements backward.
+
 2005-01-17  Ian Lance Taylor  <ian@airs.com>
 
        PR middle-end/13127:
index 14c901ddf75cdebb742100792be80a9e2236a9ab..d3607190e480e167025bb04037ca213ba5ea8b97 100644 (file)
@@ -3911,9 +3911,9 @@ tree_forwarder_block_p (basic_block bb)
   gcc_assert (bb != ENTRY_BLOCK_PTR);
 #endif
 
-  /* Now walk through the statements.  We can ignore labels, anything else
-     means this is not a forwarder block.  */
-  for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+  /* Now walk through the statements backward.  We can ignore labels,
+     anything else means this is not a forwarder block.  */
+  for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_next (&bsi))
     {
       tree stmt = bsi_stmt (bsi);