+2009-08-12 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (dependence_polyhedron_1): Replace
+ pdr_nb_subscripts with PDR_NB_SUBSCRIPTS.
+ (graphite_legal_transform_dr): Same.
+ (graphite_carried_dependence_level_k): Same.
+ * graphite-poly.c (new_poly_dr): Add a parameter nb_subscripts.
+ Initialize PDR_NB_SUBSCRIPTS.
+ (print_pdr_access_layout): Replace pdr_nb_subscripts with
+ PDR_NB_SUBSCRIPTS.
+ * graphite-poly.h (struct poly_dr): Add nb_subscripts field.
+ (PDR_NB_SUBSCRIPTS): New.
+ (pdr_nb_subscripts): Removed.
+ (pdr_dim): Simplified.
+ * graphite-sese-to-poly.c (build_poly_dr): Replace pdr_nb_subscripts
+ with PDR_NB_SUBSCRIPTS.
+
2009-08-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-interchange.c (compute_array_size): Remove use of
+2009-08-11 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (dependence_polyhedron_1): Replace
+ pdr_nb_subscripts with PDR_NB_SUBSCRIPTS.
+ (graphite_legal_transform_dr): Same.
+ (graphite_carried_dependence_level_k): Same.
+ * graphite-poly.c (new_poly_dr): Add a parameter nb_subscripts.
+ Initialize PDR_NB_SUBSCRIPTS.
+ (print_pdr_access_layout): Replace pdr_nb_subscripts with
+ PDR_NB_SUBSCRIPTS.
+ * graphite-poly.h (struct poly_dr): Add nb_subscripts field.
+ (PDR_NB_SUBSCRIPTS): New.
+ (pdr_nb_subscripts): Removed.
+ (pdr_dim): Simplified.
+ * graphite-sese-to-poly.c (build_poly_dr): Replace pdr_nb_subscripts
+ with PDR_NB_SUBSCRIPTS.
+
2009-08-11 Sebastian Pop <sebastian.pop@amd.com>
* graphite-interchange.c (compute_array_size): Remove use of
pbb_nb_scattering_orig (pbb2) : pbb_nb_scattering_transform (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 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);
ppl_Polyhedron_t so2 = PBB_ORIGINAL_SCATTERING (pbb2);
ppl_Pointset_Powerset_C_Polyhedron_t po;
- graphite_dim_t sdim1 = pdr_nb_subscripts (pdr1) + 1;
- graphite_dim_t sdim2 = pdr_nb_subscripts (pdr2) + 1;
+ graphite_dim_t sdim1 = PDR_NB_SUBSCRIPTS (pdr1) + 1;
+ graphite_dim_t sdim2 = PDR_NB_SUBSCRIPTS (pdr2) + 1;
if (sdim1 != sdim2)
return true;
ppl_Polyhedron_t so2 = PBB_TRANSFORMED_SCATTERING (pbb2);
ppl_Pointset_Powerset_C_Polyhedron_t po;
ppl_Pointset_Powerset_C_Polyhedron_t eqpp;
- graphite_dim_t sdim1 = pdr_nb_subscripts (pdr1) + 1;
- graphite_dim_t sdim2 = pdr_nb_subscripts (pdr2) + 1;
+ graphite_dim_t sdim1 = PDR_NB_SUBSCRIPTS (pdr1) + 1;
+ graphite_dim_t sdim2 = PDR_NB_SUBSCRIPTS (pdr2) + 1;
graphite_dim_t tdim1 = pbb_nb_scattering_transform (pbb1);
graphite_dim_t ddim1 = pbb_dim_iter_domain (pbb1);
ppl_dimension_type dim;
return transform_done;
}
-/* Create a new polyhedral data reference and add it to PBB. It is defined by
- its ACCESSES, its TYPE*/
+/* Create a new polyhedral data reference and add it to PBB. It is
+ defined by its ACCESSES, its TYPE, and the number of subscripts
+ NB_SUBSCRIPTS. */
void
new_poly_dr (poly_bb_p pbb,
ppl_Pointset_Powerset_C_Polyhedron_t accesses,
- enum POLY_DR_TYPE type, void *cdr)
+ enum POLY_DR_TYPE type, void *cdr, int nb_subscripts)
{
poly_dr_p pdr = XNEW (struct poly_dr);
PDR_ACCESSES (pdr) = accesses;
PDR_TYPE (pdr) = type;
PDR_CDR (pdr) = cdr;
+ PDR_NB_SUBSCRIPTS (pdr) = nb_subscripts;
VEC_safe_push (poly_dr_p, heap, PBB_DRS (pbb), pdr);
}
fprintf (file, " alias");
- for (i = 0; i < pdr_nb_subscripts (pdr); i++)
+ for (i = 0; i < PDR_NB_SUBSCRIPTS (pdr); i++)
fprintf (file, " sub%d", (int) i);
fprintf (file, " cst\n");
| p = A;
| ... = p[?][?];
| for j
- | A[i][j+b] = m;
+ | A[i][j+k] = m;
| }
The data access A[i][j+k] in alias set "5" is described like this:
- | i j k a s0 s1 1
+ | i j k a s0 s1 1
| 0 0 0 1 0 0 -5 = 0
|-1 0 0 0 1 0 0 = 0
| 0 -1 -1 0 0 1 0 = 0
polyhedron:
- | i k a s0 1
+ | i k a s0 1
| 0 0 1 0 -5 = 0
| 0 0 0 1 0 >= 0
"or"
- | i k a s0 1
+ | i k a s0 1
| 0 0 1 0 -7 = 0
| 0 0 0 1 0 >= 0
| i j k a 1
| 0 0 0 -1 15 = 0 */
ppl_Pointset_Powerset_C_Polyhedron_t accesses;
+
+ /* The number of subscripts. */
+ graphite_dim_t nb_subscripts;
};
#define PDR_CDR(PDR) (PDR->compiler_dr)
#define PDR_PBB(PDR) (PDR->pbb)
#define PDR_TYPE(PDR) (PDR->type)
#define PDR_ACCESSES(PDR) (PDR->accesses)
+#define PDR_NB_SUBSCRIPTS(PDR) (PDR->nb_subscripts)
void new_poly_dr (poly_bb_p, ppl_Pointset_Powerset_C_Polyhedron_t,
- enum POLY_DR_TYPE, void *);
+ enum POLY_DR_TYPE, void *, int);
void free_poly_dr (poly_dr_p);
void debug_pdr (poly_dr_p);
void print_pdr (FILE *, poly_dr_p);
static inline scop_p pdr_scop (poly_dr_p pdr);
-/* The number of subscripts of the PDR. */
+/* The dimension of the PDR_ACCESSES polyhedron of PDR. */
-static inline graphite_dim_t
-pdr_nb_subscripts (poly_dr_p pdr)
+static inline ppl_dimension_type
+pdr_dim (poly_dr_p pdr)
{
- poly_bb_p pbb = PDR_PBB (pdr);
ppl_dimension_type dim;
-
ppl_Pointset_Powerset_C_Polyhedron_space_dimension (PDR_ACCESSES (pdr),
&dim);
- return dim - pbb_dim_iter_domain (pbb) - pbb_nb_params (pbb) - 1;
+ return dim;
}
/* The dimension of the iteration domain of the scop of PDR. */
return scop_nb_params (pdr_scop (pdr));
}
-/* The dimension of the accesses polyhedron of PDR. */
-
-static inline graphite_dim_t
-pdr_dim (poly_dr_p pdr)
-{
- graphite_dim_t alias_nb_dimensions = 1;
-
- return pbb_dim_iter_domain (PDR_PBB (pdr)) + alias_nb_dimensions
- + pdr_nb_subscripts (pdr) + scop_nb_params (pdr_scop (pdr));
-}
-
/* The dimension of the alias set in PDR. */
static inline ppl_dimension_type
ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (&accesses_ps,
accesses);
ppl_delete_Polyhedron (accesses);
- new_poly_dr (pbb, accesses_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. */