tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a call to find_edge outside...
authorKazu Hirata <kazu@cs.umass.edu>
Tue, 26 Apr 2005 16:53:53 +0000 (16:53 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Tue, 26 Apr 2005 16:53:53 +0000 (16:53 +0000)
* tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a
call to find_edge outside a loop to go through a PHI chain.

From-SVN: r98776

gcc/ChangeLog
gcc/tree-cfg.c

index 2d57e1f2e811a922a181ca7be93e8d0432bc0f6b..4cf31bca036576ed3e55566b5edeee6b4211719c 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-26  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a
+       call to find_edge outside a loop to go through a PHI chain.
+
 2004-04-26  Richard Guenther  <rguenth@gcc.gnu.org>
 
        PR tree-optimization/17598
index a9098cdc465b2731e43e9e28c9fbd64546a73645..93714d7c8dacbd67eca50fec417e47efd7710d2d 100644 (file)
@@ -5398,6 +5398,11 @@ tree_lv_adjust_loop_header_phi (basic_block first, basic_block second,
                                basic_block new_head, edge e)
 {
   tree phi1, phi2;
+  edge e2 = find_edge (new_head, second);
+
+  /* Because NEW_HEAD has been created by splitting SECOND's incoming
+     edge, we should always have an edge from NEW_HEAD to SECOND.  */
+  gcc_assert (e2 != NULL);
 
   /* Browse all 'second' basic block phi nodes and add phi args to
      edge 'e' for 'first' head. PHI args are always in correct order.  */
@@ -5406,13 +5411,8 @@ tree_lv_adjust_loop_header_phi (basic_block first, basic_block second,
        phi2 && phi1; 
        phi2 = PHI_CHAIN (phi2),  phi1 = PHI_CHAIN (phi1))
     {
-      edge e2 = find_edge (new_head, second);
-
-      if (e2)
-       {
-         tree def = PHI_ARG_DEF (phi2, e2->dest_idx);
-         add_phi_arg (phi1, def, e);
-       }
+      tree def = PHI_ARG_DEF (phi2, e2->dest_idx);
+      add_phi_arg (phi1, def, e);
     }
 }