]> gcc.gnu.org Git - gcc.git/commitdiff
loop.c (loop_ivs_free): New function.
authorMichael Hayes <mhayes@redhat.com>
Mon, 1 Jan 2001 00:53:38 +0000 (00:53 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Mon, 1 Jan 2001 00:53:38 +0000 (00:53 +0000)
* loop.c (loop_ivs_free): New function.
(strength_reduce): Break out from...

From-SVN: r38583

gcc/ChangeLog
gcc/loop.c

index 6f813063c06b29f622100134fe380c441cc29b16..8207a7bf908c04e52ae68b85bfb8b03dcebb24ce 100644 (file)
@@ -1,5 +1,10 @@
 2001-01-01  Michael Hayes  <mhayes@redhat.com>
 
+       * loop.c (loop_ivs_free): New function.
+       (strength_reduce): Break out from...
+
+2001-01-01  Michael Hayes  <mhayes@redhat.com>
+       
        * loop.h (struct iv): New.
        (REG_IV_TYPE, REG_IV_CLASS, REG_INFO): Modify to use 'struct iv'.
        (struct loop_ivs): Replace 'reg_iv_type', 'reg_iv_info',
index 5882a813d518f0fde3c65df6167798980c70c6d6..d6c24037f4a5c81b31c6d4e0ce4a685f8cbf50c2 100644 (file)
@@ -194,6 +194,7 @@ static void loop_givs_dead_check PARAMS((struct loop *, struct iv_class *));
 static void loop_givs_reduce PARAMS((struct loop *, struct iv_class *));
 static void loop_givs_rescan PARAMS((struct loop *, struct iv_class *,
                                     rtx *, rtx));
+static void loop_ivs_free PARAMS((struct loop *));
 static void strength_reduce PARAMS ((struct loop *, int, int));
 static void find_single_use_in_loop PARAMS ((rtx, rtx, varray_type));
 static int valid_initial_value_p PARAMS ((rtx, rtx, int, rtx));
@@ -4250,6 +4251,40 @@ loop_giv_reduce_benefit (loop, bl, v, test_reg)
 }
 
 
+/* Free IV structures for LOOP.  */
+
+static void
+loop_ivs_free (loop)
+     struct loop *loop;
+{
+  struct loop_ivs *ivs = LOOP_IVS (loop);
+  struct iv_class *iv = ivs->list;
+  
+  free (ivs->regs);
+
+  while (iv)
+    {
+      struct iv_class *next = iv->next;
+      struct induction *induction;
+      struct induction *next_induction;
+      
+      for (induction = iv->biv; induction; induction = next_induction)
+       {
+         next_induction = induction->next_iv;
+         free (induction);
+       }
+      for (induction = iv->giv; induction; induction = next_induction)
+       {
+         next_induction = induction->next_iv;
+         free (induction);
+       }
+      
+      free (iv);
+      iv = next;
+    }
+}
+
+
 /* Perform strength reduction and induction variable elimination.
 
    Pseudo registers created during this function will be beyond the
@@ -4312,7 +4347,8 @@ strength_reduce (loop, insn_count, flags)
       if (flags & LOOP_UNROLL)
        unroll_loop (loop, insn_count, end_insert_before, 0);
 
-      goto egress;
+      loop_ivs_free (loop);
+      return;
     }
 
   /* Determine how BIVS are initialised by looking through pre-header
@@ -4571,31 +4607,7 @@ strength_reduce (loop, insn_count, flags)
   if (loop_dump_stream)
     fprintf (loop_dump_stream, "\n");
 
-egress:
-  free (ivs->regs);
-  {
-    struct iv_class *iv = ivs->list;
-
-    while (iv) {
-      struct iv_class *next = iv->next;
-      struct induction *induction;
-      struct induction *next_induction;
-
-      for (induction = iv->biv; induction; induction = next_induction)
-       {
-         next_induction = induction->next_iv;
-         free (induction);
-       }
-      for (induction = iv->giv; induction; induction = next_induction)
-       {
-         next_induction = induction->next_iv;
-         free (induction);
-       }
-
-      free (iv);
-      iv = next;
-    }
-  }
+  loop_ivs_free (loop);
   if (reg_map)
     free (reg_map);
 }
This page took 0.087335 seconds and 5 git commands to generate.