bb-reorder.c (find_traces_1_round): Speed up by using EDGE_COUNT instead of FOR_EACH_...
authorKazu Hirata <kazu@cs.umass.edu>
Sat, 27 Nov 2004 17:33:11 +0000 (17:33 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sat, 27 Nov 2004 17:33:11 +0000 (17:33 +0000)
* bb-reorder.c (find_traces_1_round): Speed up by using
EDGE_COUNT instead of FOR_EACH_EDGE.

From-SVN: r91386

gcc/ChangeLog
gcc/bb-reorder.c

index 95ae7a726177cb10b812ccd420e221321018b1ca..9ff8e91ac7bf83b6e118464964318c508697d9b0 100644 (file)
@@ -6,6 +6,9 @@
        Replace operand_equal_p with operand_for_phi_arg_p
        appropriately.
 
+       * bb-reorder.c (find_traces_1_round): Speed up by using
+       EDGE_COUNT instead of FOR_EACH_EDGE.
+
 2004-11-27  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR pch/14940
index 603f921c5e829d9983a435b54f5b6934b18c6f0c..774affb76786f5b0d7b4568bd2e856658b776f52 100644 (file)
@@ -638,14 +638,8 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
                        {
                          /* The loop has less than 4 iterations.  */
 
-                         /* Check whether there is another edge from BB.  */
-                         edge another_edge;
-                         FOR_EACH_EDGE (another_edge, ei, bb->succs)
-                           if (another_edge != best_edge)
-                             break;
-
-                         if (!another_edge && copy_bb_p (best_edge->dest,
-                                                         !optimize_size))
+                         if (EDGE_COUNT (bb->succs) == 1
+                             && copy_bb_p (best_edge->dest, !optimize_size))
                            {
                              bb = copy_bb (best_edge->dest, best_edge, bb,
                                            *n_traces);