OSDN Git Service

2010-11-25 Basile Starynkevitch <basile@starynkevitch.net>
[pf3gnuchains/gcc-fork.git] / gcc / graphite-poly.c
index 4214f9e..0dbd61c 100644 (file)
@@ -606,7 +606,7 @@ graphite_read_scop_file (FILE *file, scop_p scop)
 
   if (strcmp (tmp, "SCoP 1"))
     {
-      error ("The file is not in OpenScop format.\n");
+      error ("the file is not in OpenScop format");
       return false;
     }
 
@@ -617,7 +617,7 @@ graphite_read_scop_file (FILE *file, scop_p scop)
 
   if (strcmp (language, "Gimple"))
     {
-      error ("The language is not recognized\n");
+      error ("the language is not recognized");
       return false;
     }
 
@@ -628,8 +628,8 @@ graphite_read_scop_file (FILE *file, scop_p scop)
 
   if ((size_t) params != scop->nb_params)
     {
-      error ("Parameters number in the scop file is different from the"
-            " internal scop parameter number.");
+      error ("parameters number in the scop file is different from the"
+            " internal scop parameter number");
       return false;
     }
 
@@ -641,8 +641,8 @@ graphite_read_scop_file (FILE *file, scop_p scop)
 
   if (nb_statements != VEC_length (poly_bb_p, SCOP_BBS (scop)))
     {
-      error ("Number of statements in the OpenScop file does not match"
-            " the graphite internal statements number.");
+      error ("number of statements in the OpenScop file does not match"
+            " the graphite internal statements number");
       return false;
     }
 
@@ -783,6 +783,9 @@ apply_poly_transforms (scop_p scop)
        transform_done |= scop_do_interchange (scop);
     }
 
+  if (flag_loop_flatten)
+    transform_done |= flatten_all_loops (scop);
+
   /* This feature is only enabled in the Graphite branch.  */
   if (0)
     {
@@ -1635,6 +1638,7 @@ pbb_number_of_iterations_at_time (poly_bb_p pbb,
 {
   ppl_Pointset_Powerset_C_Polyhedron_t domain, sctr_lb, sctr_ub;
   ppl_dimension_type domain_dim, sctr_dim;
+  graphite_dim_t dim_iter_domain = pbb_dim_iter_domain (pbb);
   ppl_Linear_Expression_t le;
   mpz_t lb, ub, diff, one;
   int i;
@@ -1645,6 +1649,7 @@ pbb_number_of_iterations_at_time (poly_bb_p pbb,
     (&domain, PBB_DOMAIN (pbb));
 
   ppl_Pointset_Powerset_C_Polyhedron_space_dimension (domain, &domain_dim);
+
   mpz_init (diff);
   mpz_init (lb);
   mpz_init (ub);
@@ -1655,7 +1660,7 @@ pbb_number_of_iterations_at_time (poly_bb_p pbb,
      that upper bound to the scattering.  */
   ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
     (&sctr_ub, PBB_TRANSFORMED_SCATTERING (pbb));
-  for (i = 0; i < (int) domain_dim; i++)
+  for (i = 0; i < (int) dim_iter_domain; i++)
     {
       ppl_Linear_Expression_t eq;
       ppl_Constraint_t pc;
@@ -1688,10 +1693,11 @@ pbb_number_of_iterations_at_time (poly_bb_p pbb,
       ppl_delete_Constraint_System (cs);
     }
 
-  /* Compute the lower bound on the original iteration domain.  */
+  /* Compute the lower bound on the original iteration domain and add
+     it to the scattering.  */
   ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
     (&sctr_lb, PBB_TRANSFORMED_SCATTERING (pbb));
-  for (i = 0; i < (int) domain_dim; i++)
+  for (i = 0; i < (int) dim_iter_domain; i++)
     {
       ppl_Linear_Expression_t eq;
       ppl_Constraint_t pc;
@@ -1732,8 +1738,10 @@ pbb_number_of_iterations_at_time (poly_bb_p pbb,
   mpz_clear (diff);
   mpz_clear (lb);
   mpz_clear (ub);
+  ppl_delete_Linear_Expression (le);
   ppl_delete_Pointset_Powerset_C_Polyhedron (sctr_ub);
   ppl_delete_Pointset_Powerset_C_Polyhedron (sctr_lb);
+  ppl_delete_Pointset_Powerset_C_Polyhedron (domain);
 }
 
 /* Translates LOOP to LST.  */