]> gcc.gnu.org Git - gcc.git/commitdiff
tree-ssa-loop-manip.c (lv_adjust_loop_header_phi): Use find_edge to find the index...
authorKazu Hirata <kazu@cs.umass.edu>
Wed, 24 Nov 2004 13:35:38 +0000 (13:35 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Wed, 24 Nov 2004 13:35:38 +0000 (13:35 +0000)
* tree-ssa-loop-manip.c (lv_adjust_loop_header_phi): Use
find_edge to find the index of a PHI argument.

From-SVN: r91155

gcc/ChangeLog
gcc/tree-ssa-loop-manip.c

index 9dd15b29cbe15b6d59f740ca9e9813bd4ee398f0..9afd037a3f934a9e4484eb2861da4f665fcddb28 100644 (file)
@@ -3,6 +3,9 @@
        * tree-ssa-pre.c (phi_translate): Use find_edge to find the
        index of a PHI argument.
 
+       * tree-ssa-loop-manip.c (lv_adjust_loop_header_phi): Use
+       find_edge to find the index of a PHI argument.
+
 2004-11-24  Steven Bosscher  <stevenb@suse.de>
 
        * expr.c (expand_expr_real_1): Remove cases for EXIT_BLOCK_EXPR 
index 43499560e5495cfaa05fb7bb5e0c7e72d9b3e00c..3a8784985f7c847264d1b82aa0b1d11cbae9fc1e 100644 (file)
@@ -667,14 +667,12 @@ lv_adjust_loop_header_phi (basic_block first, basic_block second,
        phi2 && phi1; 
        phi2 = PHI_CHAIN (phi2),  phi1 = PHI_CHAIN (phi1))
     {
-      int i;
-      for (i = 0; i < PHI_NUM_ARGS (phi2); i++)
+      edge e2 = find_edge (new_head, second);
+
+      if (e2)
        {
-         if (PHI_ARG_EDGE (phi2, i)->src == new_head)
-           {
-             tree def = PHI_ARG_DEF (phi2, i);
-             add_phi_arg (&phi1, def, e);
-           }
+         tree def = PHI_ARG_DEF (phi2, e2->dest_idx);
+         add_phi_arg (&phi1, def, e);
        }
     }
 }
This page took 0.07325 seconds and 5 git commands to generate.