OSDN Git Service

Add comment saying file is deprecated
[pf3gnuchains/gcc-fork.git] / gcc / graphite-sese-to-poly.c
index 4ed7ffc..ad64b8c 100644 (file)
@@ -498,6 +498,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
 
   value_init (v);
   ppl_new_Coefficient (&c);
+  PBB_TRANSFORMED (pbb) = poly_scattering_new ();
   ppl_new_C_Polyhedron_from_space_dimension
     (&PBB_TRANSFORMED_SCATTERING (pbb), dim, 0);
 
@@ -543,8 +544,7 @@ build_pbb_scattering_polyhedrons (ppl_Linear_Expression_t static_schedule,
   value_clear (v);
   ppl_delete_Coefficient (c);
 
-  ppl_new_C_Polyhedron_from_C_Polyhedron (&PBB_ORIGINAL_SCATTERING (pbb),
-                                         PBB_TRANSFORMED_SCATTERING (pbb));
+  PBB_ORIGINAL (pbb) = poly_scattering_copy (PBB_TRANSFORMED (pbb));
 }
 
 /* Build for BB the static schedule.
@@ -1643,12 +1643,12 @@ pdr_add_memory_accesses (ppl_Polyhedron_t accesses, data_reference_p dr,
 }
 
 /* Add constrains representing the size of the accessed data to the
-   DATA_CONTAINER polyhedron.  ACCESSP_NB_DIMS is the dimension of the
-   DATA_CONTAINER polyhedron, DOM_NB_DIMS is the dimension of the iteration
+   ACCESSES polyhedron.  ACCESSP_NB_DIMS is the dimension of the
+   ACCESSES polyhedron, DOM_NB_DIMS is the dimension of the iteration
    domain.  */
 
 static void
-pdr_add_data_dimensions (ppl_Polyhedron_t data_container, data_reference_p dr,
+pdr_add_data_dimensions (ppl_Polyhedron_t accesses, data_reference_p dr,
                         ppl_dimension_type accessp_nb_dims,
                         ppl_dimension_type dom_nb_dims)
 {
@@ -1669,12 +1669,13 @@ pdr_add_data_dimensions (ppl_Polyhedron_t data_container, data_reference_p dr,
       ppl_Linear_Expression_t expr;
       ppl_Constraint_t cstr;
       ppl_dimension_type subscript = dom_nb_dims + 1 + i;
+      int size;
 
       /* 0 <= subscript */
       ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
       ppl_set_coef (expr, subscript, 1);
       ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
-      ppl_Polyhedron_add_constraint (data_container, cstr);
+      ppl_Polyhedron_add_constraint (accesses, cstr);
       ppl_delete_Linear_Expression (expr);
       ppl_delete_Constraint (cstr);
 
@@ -1685,16 +1686,19 @@ pdr_add_data_dimensions (ppl_Polyhedron_t data_container, data_reference_p dr,
        break;
 
       /* subscript <= array_size */
-      ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
-      ppl_set_coef (expr, subscript, -1);
+      size = elt_size ? int_cst_value (array_size) / elt_size : 0;
+      if (size)
+       {
+         ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
+         ppl_set_coef (expr, subscript, -1);
 
-      if (elt_size)
-       ppl_set_inhomogeneous (expr, int_cst_value (array_size) / elt_size);
+         ppl_set_inhomogeneous (expr, size);
 
-      ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
-      ppl_Polyhedron_add_constraint (data_container, cstr);
-      ppl_delete_Linear_Expression (expr);
-      ppl_delete_Constraint (cstr);
+         ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
+         ppl_Polyhedron_add_constraint (accesses, cstr);
+         ppl_delete_Linear_Expression (expr);
+         ppl_delete_Constraint (cstr);
+       }
 
       elt_size = int_cst_value (array_size);
     }
@@ -1705,8 +1709,8 @@ pdr_add_data_dimensions (ppl_Polyhedron_t data_container, data_reference_p dr,
 static void
 build_poly_dr (data_reference_p dr, poly_bb_p pbb)
 {
-  ppl_Polyhedron_t accesses, data_container;
-  ppl_Pointset_Powerset_C_Polyhedron_t accesses_ps, data_container_ps;
+  ppl_Polyhedron_t accesses;
+  ppl_Pointset_Powerset_C_Polyhedron_t accesses_ps;
   ppl_dimension_type dom_nb_dims;
   ppl_dimension_type accessp_nb_dims;
 
@@ -1715,21 +1719,16 @@ build_poly_dr (data_reference_p dr, poly_bb_p pbb)
   accessp_nb_dims = dom_nb_dims + 1 + DR_NUM_DIMENSIONS (dr);
 
   ppl_new_C_Polyhedron_from_space_dimension (&accesses, accessp_nb_dims, 0);
-  ppl_new_C_Polyhedron_from_space_dimension (&data_container,
-                                            accessp_nb_dims, 0);
 
   pdr_add_alias_set (accesses, dr, accessp_nb_dims, dom_nb_dims);
   pdr_add_memory_accesses (accesses, dr, accessp_nb_dims, dom_nb_dims, pbb);
-  pdr_add_data_dimensions (data_container, dr, accessp_nb_dims, dom_nb_dims);
+  pdr_add_data_dimensions (accesses, dr, accessp_nb_dims, dom_nb_dims);
 
   ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (&accesses_ps,
                                                            accesses);
-  ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (&data_container_ps,
-                                                           data_container);
   ppl_delete_Polyhedron (accesses);
-  ppl_delete_Polyhedron (data_container);
-  new_poly_dr (pbb, accesses_ps, data_container_ps,
-              DR_IS_READ (dr) ? PDR_READ : PDR_WRITE, dr);
+  new_poly_dr (pbb, accesses_ps, DR_IS_READ (dr) ? PDR_READ : PDR_WRITE, dr,
+              DR_NUM_DIMENSIONS (dr));
 }
 
 /* Group each data reference in DRS with it's alias set num.  */