OSDN Git Service

* tree-vrp.c (adjust_range_with_scev): Use get_chrec_loop.
[pf3gnuchains/gcc-fork.git] / gcc / modulo-sched.c
index 4160e99..3352e20 100644 (file)
@@ -878,12 +878,11 @@ sms_schedule (void)
   ddg_ptr *g_arr, g;
   int * node_order;
   int maxii;
-  unsigned i,num_loops;
+  loop_iterator li;
   partial_schedule_ptr ps;
   struct df *df;
   basic_block bb = NULL;
-  /* vars to the versioning only if needed*/
-  struct loop * nloop;
+  struct loop *loop, *nloop;
   basic_block condition_bb = NULL;
   edge latch_edge;
   gcov_type trip_count = 0;
@@ -921,16 +920,14 @@ sms_schedule (void)
 
   /* Allocate memory to hold the DDG array one entry for each loop.
      We use loop->num as index into this array.  */
-  g_arr = XCNEWVEC (ddg_ptr, current_loops->num);
-
+  g_arr = XCNEWVEC (ddg_ptr, number_of_loops ());
 
   /* Build DDGs for all the relevant loops and hold them in G_ARR
      indexed by the loop index.  */
-  for (i = 0; i < current_loops->num; i++)
+  FOR_EACH_LOOP (li, loop, 0)
     {
       rtx head, tail;
       rtx count_reg;
-      struct loop *loop = current_loops->parray[i];
 
       /* For debugging.  */
       if ((passes++ > MAX_SMS_LOOP_NUMBER) && (MAX_SMS_LOOP_NUMBER != -1))
@@ -1019,7 +1016,7 @@ sms_schedule (void)
          continue;
         }
 
-      g_arr[i] = g;
+      g_arr[loop->num] = g;
     }
 
   /* Release Data Flow analysis data structures.  */
@@ -1027,18 +1024,15 @@ sms_schedule (void)
   df = NULL;
 
   /* We don't want to perform SMS on new loops - created by versioning.  */
-  num_loops = current_loops->num;
-  /* Go over the built DDGs and perfrom SMS for each one of them.  */
-  for (i = 0; i < num_loops; i++)
+  FOR_EACH_LOOP (li, loop, LI_ONLY_OLD)
     {
       rtx head, tail;
       rtx count_reg, count_init;
       int mii, rec_mii;
       unsigned stage_count = 0;
       HOST_WIDEST_INT loop_count = 0;
-      struct loop *loop = current_loops->parray[i];
 
-      if (! (g = g_arr[i]))
+      if (! (g = g_arr[loop->num]))
         continue;
 
       if (dump_file)