- /* There is no dependence. */
- ppl_delete_Pointset_Powerset_C_Polyhedron (*res);
- ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (res, dim, 1);
-}
-
-/* Build the dependence polyhedron for data references PDR1 and PDR2.
- The layout of the dependence polyhedron is:
-
- T1|I1|T2|I2|S1|S2|G
-
- with
- | T1 and T2 the scattering dimensions for PDR1 and PDR2
- | I1 and I2 the iteration domains
- | S1 and S2 the subscripts
- | G the global parameters.
-
- When DIRECTION is set to 1, compute the direct dependence from PDR1
- to PDR2, and when DIRECTION is -1, compute the reversed dependence
- relation, from PDR2 to PDR1. */
-
-static ppl_Pointset_Powerset_C_Polyhedron_t
-dependence_polyhedron_1 (poly_dr_p pdr1, poly_dr_p pdr2,
- int direction, bool original_scattering_p)
-{
- poly_bb_p pbb1 = PDR_PBB (pdr1);
- poly_bb_p pbb2 = PDR_PBB (pdr2);
- scop_p scop = PBB_SCOP (pbb1);
- ppl_Pointset_Powerset_C_Polyhedron_t d1 = PBB_DOMAIN (pbb1);
- ppl_Pointset_Powerset_C_Polyhedron_t d2 = PBB_DOMAIN (pbb2);
- graphite_dim_t tdim1 = original_scattering_p ?
- pbb_nb_scattering_orig (pbb1) : pbb_nb_scattering_transform (pbb1);
- graphite_dim_t tdim2 = original_scattering_p ?
- pbb_nb_scattering_orig (pbb2) : pbb_nb_scattering_transform (pbb2);
- ppl_Polyhedron_t scat1 = original_scattering_p ?
- PBB_ORIGINAL_SCATTERING (pbb1) : PBB_TRANSFORMED_SCATTERING (pbb1);
- ppl_Polyhedron_t scat2 = original_scattering_p ?
- PBB_ORIGINAL_SCATTERING (pbb2) : PBB_TRANSFORMED_SCATTERING (pbb2);
- graphite_dim_t ddim1 = pbb_dim_iter_domain (pbb1);
- graphite_dim_t ddim2 = pbb_dim_iter_domain (pbb2);
- graphite_dim_t sdim1 = PDR_NB_SUBSCRIPTS (pdr1) + 1;
- graphite_dim_t gdim = scop_nb_params (scop);
- graphite_dim_t dim1 = pdr_dim (pdr1);
- graphite_dim_t dim2 = pdr_dim (pdr2);
- graphite_dim_t dim = tdim1 + tdim2 + dim1 + dim2 - gdim;
- ppl_Pointset_Powerset_C_Polyhedron_t res;
- ppl_Pointset_Powerset_C_Polyhedron_t id1, id2, isc1, isc2, idr1, idr2;
- ppl_Pointset_Powerset_C_Polyhedron_t sc1, sc2, dreq;
- ppl_Pointset_Powerset_C_Polyhedron_t context;
-
- gcc_assert (PBB_SCOP (pbb1) == PBB_SCOP (pbb2));
-
- ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
- (&context, SCOP_CONTEXT (scop));
- ppl_insert_dimensions_pointset (context, 0, dim - gdim);
-
- ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (&sc1, scat1);
- ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (&sc2, scat2);
-
- id1 = map_into_dep_poly (dim, gdim, d1, ddim1, tdim1);
- id2 = map_into_dep_poly (dim, gdim, d2, ddim2, tdim1 + ddim1 + tdim2);
- isc1 = map_into_dep_poly (dim, gdim, sc1, ddim1 + tdim1, 0);
- isc2 = map_into_dep_poly (dim, gdim, sc2, ddim2 + tdim2, tdim1 + ddim1);
-
- idr1 = map_dr_into_dep_poly (dim, PDR_ACCESSES (pdr1), ddim1, ddim1 + gdim,
- tdim1, tdim2 + ddim2);
- idr2 = map_dr_into_dep_poly (dim, PDR_ACCESSES (pdr2), ddim2, ddim2 + gdim,
- tdim1 + ddim1 + tdim2, sdim1);
-
- /* Now add the subscript equalities. */
- dreq = dr_equality_constraints (dim, tdim1 + ddim1 + tdim2 + ddim2, sdim1);
-
- ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (&res, dim, 0);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, context);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, id1);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, id2);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, isc1);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, isc2);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, idr1);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, idr2);
- ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, dreq);
- ppl_delete_Pointset_Powerset_C_Polyhedron (context);
- ppl_delete_Pointset_Powerset_C_Polyhedron (id1);
- ppl_delete_Pointset_Powerset_C_Polyhedron (id2);
- ppl_delete_Pointset_Powerset_C_Polyhedron (sc1);
- ppl_delete_Pointset_Powerset_C_Polyhedron (sc2);
- ppl_delete_Pointset_Powerset_C_Polyhedron (isc1);
- ppl_delete_Pointset_Powerset_C_Polyhedron (isc2);
- ppl_delete_Pointset_Powerset_C_Polyhedron (idr1);
- ppl_delete_Pointset_Powerset_C_Polyhedron (idr2);
- ppl_delete_Pointset_Powerset_C_Polyhedron (dreq);
-
- if (!ppl_Pointset_Powerset_C_Polyhedron_is_empty (res))
- build_lexicographical_constraint (&res, dim, MIN (tdim1, tdim2),
- tdim1 + ddim1, direction);
-