OSDN Git Service

2010-04-23 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / graphite-blocking.c
index 3cf60e9..769cda4 100644 (file)
@@ -181,16 +181,16 @@ pbb_strip_mine_profitable_p (poly_bb_p pbb,
                             graphite_dim_t depth,
                             int stride)
 {
-  Value niter, strip_stride;
+  mpz_t niter, strip_stride;
   bool res;
 
-  value_init (strip_stride);
-  value_init (niter);
-  value_set_si (strip_stride, stride);
+  mpz_init (strip_stride);
+  mpz_init (niter);
+  mpz_set_si (strip_stride, stride);
   pbb_number_of_iterations_at_time (pbb, psct_dynamic_dim (pbb, depth), niter);
-  res = value_gt (niter, strip_stride);
-  value_clear (strip_stride);
-  value_clear (niter);
+  res = (mpz_cmp (niter, strip_stride) > 0);
+  mpz_clear (strip_stride);
+  mpz_clear (niter);
 
   return res;
 }
@@ -285,25 +285,27 @@ scop_do_strip_mine (scop_p scop)
 bool
 scop_do_block (scop_p scop)
 {
-  bool transform_done = false;
+  bool strip_mined = false;
+  bool interchanged = false;
 
   store_scattering (scop);
 
-  lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop));
-  transform_done = scop_do_interchange (scop);
+  strip_mined = lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop));
+  interchanged = scop_do_interchange (scop);
 
   /* If we don't interchange loops, then the strip mine is not
      profitable, and the transform is not a loop blocking.  */
-  if (!transform_done
+  if (!interchanged
       || !graphite_legal_transform (scop))
     {
       restore_scattering (scop);
       return false;
     }
-  else if (dump_file && (dump_flags & TDF_DETAILS))
+  else if (strip_mined && interchanged
+          && dump_file && (dump_flags & TDF_DETAILS))
     fprintf (dump_file, "SCoP will be loop blocked.\n");
 
-  return transform_done;
+  return strip_mined || interchanged;
 }
 
 #endif