Commit ae403f5a by Riyadh Baghdadi Committed by Sebastian Pop

Write OpenScop format.

2010-07-29  Riyadh Baghdadi <baghdadi.mr@gmail.com>

	* graphite-cloog-util.c (openscop_print_cloog_matrix): New.
	(openscop_print_polyhedron_matrix): New.
	* graphite-cloog-util.h (openscop_print_polyhedron_matrix): Declared.
	* graphite-poly.c (openscop_print_pdr_polyhedron): Same.
	(openscop_print_pdr_powerset): New.
	(openscop_print_powerset_matrix): New.
	(openscop_print_scattering_function_1): New.
	(print_scattering_function): Add support for scattering names and
	OpenScop format.
	(graphite_write_transforms): Remove.
	(apply_poly_transforms): Updated to call print_scop.
	(print_pdr_access_layout): Updated to support OpenScop format.
	(print_pdr): Same.
	(openscop_print_pbb_domain): New.
	(print_pbb_body): Added a parameter to allow indicating that pbb_body is
	not provided.
	(print_pbb): Updated to call the new print_pbb_body.
	(openscop_print_scop_context): New.
	(print_scop_header): New.
	(print_scop): Updated to call print_scop_header.
	* graphite-poly.h: Document OpenScop format.

From-SVN: r164770
parent c8c2d4e7
2010-09-30 Riyadh Baghdadi <baghdadi.mr@gmail.com>
* graphite-cloog-util.c (openscop_print_cloog_matrix): New.
(openscop_print_polyhedron_matrix): New.
* graphite-cloog-util.h (openscop_print_polyhedron_matrix): Declared.
* graphite-poly.c (openscop_print_pdr_polyhedron): Same.
(openscop_print_pdr_powerset): New.
(openscop_print_powerset_matrix): New.
(openscop_print_scattering_function_1): New.
(print_scattering_function): Add support for scattering names and
OpenScop format.
(graphite_write_transforms): Remove.
(print_pdr_access_layout): Updated to support OpenScop format.
(print_pdr): Same.
(openscop_print_pbb_domain): New.
(print_pbb_body): Added a parameter to allow indicating that pbb_body is
not provided.
(print_pbb): Updated to call the new print_pbb_body.
(openscop_print_scop_context): New.
(print_scop_header): New.
(print_scop): Updated to call print_scop_header.
* graphite-poly.h: Document OpenScop format.
2010-09-30 Anatoly Sokolov <aesok@post.ru> 2010-09-30 Anatoly Sokolov <aesok@post.ru>
* config/cris/m32c.c (cris_memory_move_cost): New. * config/cris/m32c.c (cris_memory_move_cost): New.
2010-07-29 Riyadh Baghdadi <baghdadi.mr@gmail.com>
* graphite-cloog-util.c (openscop_print_cloog_matrix): New.
(openscop_print_polyhedron_matrix): New.
* graphite-cloog-util.h (openscop_print_polyhedron_matrix): Declared.
* graphite-poly.c (openscop_print_pdr_polyhedron): Same.
(openscop_print_pdr_powerset): New.
(openscop_print_powerset_matrix): New.
(openscop_print_scattering_function_1): New.
(print_scattering_function): Add support for scattering names and
OpenScop format.
(graphite_write_transforms): Remove.
(apply_poly_transforms): Updated to call print_scop.
(print_pdr_access_layout): Updated to support OpenScop format.
(print_pdr): Same.
(openscop_print_pbb_domain): New.
(print_pbb_body): Added a parameter to allow indicating that pbb_body is
not provided.
(print_pbb): Updated to call the new print_pbb_body.
(openscop_print_scop_context): New.
(print_scop_header): New.
(print_scop): Updated to call print_scop_header.
* graphite-poly.h: Document OpenScop format.
2010-07-29 Sebastian Pop <sebastian.pop@amd.com> 2010-07-29 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back
......
...@@ -296,4 +296,43 @@ new_Cloog_Domain_from_ppl_Pointset_Powerset ...@@ -296,4 +296,43 @@ new_Cloog_Domain_from_ppl_Pointset_Powerset
return res; return res;
} }
/* Print to FILE the matrix MAT in OpenScop format. OUTPUT is the number
of output dimensions, INPUT is the number of input dimensions, LOCALS
is the number of existentially quantified variables and PARAMS is the
number of parameters. */
static void
openscop_print_cloog_matrix (FILE *file, CloogMatrix *mat,
int output, int input, int locals,
int params)
{
int i, j;
fprintf (file, "%d %d %d %d %d %d \n", cloog_matrix_nrows (mat),
cloog_matrix_ncolumns (mat), output, input, locals, params);
for (i = 0; i < cloog_matrix_nrows (mat); i++)
{
for (j = 0; j < cloog_matrix_ncolumns (mat); j++)
fprintf (file, "%6ld ", mpz_get_si (mat->p[i][j]));
fprintf (file, "\n");
}
}
/* Print to FILE the polyhedron PH in OpenScop format. OUTPUT is the number
of output dimensions, INPUT is the number of input dimensions, LOCALS is
the number of existentially quantified variables and PARAMS is the number
of parameters. */
void
openscop_print_polyhedron_matrix (FILE *file, ppl_const_Polyhedron_t ph,
int output, int input, int locals,
int params)
{
CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph);
openscop_print_cloog_matrix (file, mat, output, input, locals, params);
cloog_matrix_free (mat);
}
#endif #endif
...@@ -32,5 +32,7 @@ CloogScattering *new_Cloog_Scattering_from_ppl_Polyhedron ...@@ -32,5 +32,7 @@ CloogScattering *new_Cloog_Scattering_from_ppl_Polyhedron
CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset
(ppl_Pointset_Powerset_C_Polyhedron_t, int, CloogState *); (ppl_Pointset_Powerset_C_Polyhedron_t, int, CloogState *);
void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *); void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);
void openscop_print_polyhedron_matrix (FILE *, ppl_const_Polyhedron_t, int,
int, int, int);
#endif /* GRAPHITE_CLOOG_UTIL_H */ #endif /* GRAPHITE_CLOOG_UTIL_H */
...@@ -132,7 +132,54 @@ struct poly_dr ...@@ -132,7 +132,54 @@ struct poly_dr
dimensions. dimensions.
| i j k a 1 | i j k a 1
| 0 0 0 -1 15 = 0 */ | 0 0 0 -1 15 = 0
The difference between the graphite internal format for access data and
the OpenSop format is in the order of columns.
Instead of having:
| 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
| 0 0 0 0 1 0 0 >= 0 # The last four lines describe the
| 0 0 0 0 0 1 0 >= 0 # array size.
| 0 0 0 0 -1 0 1335 >= 0
| 0 0 0 0 0 -1 123 >= 0
In OpenScop we have:
| a s0 s1 i j k 1
| 1 0 0 0 0 0 -5 = 0
| 0 1 0 -1 0 0 0 = 0
| 0 0 1 0 -1 -1 0 = 0
| 0 1 0 0 0 0 0 >= 0 # The last four lines describe the
| 0 0 1 0 0 0 0 >= 0 # array size.
| 0 -1 0 0 0 0 1335 >= 0
| 0 0 -1 0 0 0 123 >= 0
The OpenScop access function is printed as follows:
| 1 # The number of disjunct components in a union of access functions.
| R C O I L P # Described bellow.
| a s0 s1 i j k 1
| 1 0 0 0 0 0 -5 = 0
| 0 1 0 -1 0 0 0 = 0
| 0 0 1 0 -1 -1 0 = 0
| 0 1 0 0 0 0 0 >= 0 # The last four lines describe the
| 0 0 1 0 0 0 0 >= 0 # array size.
| 0 -1 0 0 0 0 1335 >= 0
| 0 0 -1 0 0 0 123 >= 0
Where:
- R: Number of rows.
- C: Number of columns.
- O: Number of output dimensions = alias set + number of subscripts.
- I: Number of input dimensions (iterators).
- L: Number of local (existentially quantified) dimensions.
- P: Number of parameters.
In the example, the vector "R C O I L P" is "7 7 3 2 0 1". */
ppl_Pointset_Powerset_C_Polyhedron_t accesses; ppl_Pointset_Powerset_C_Polyhedron_t accesses;
/* Data reference's base object set number, we must assure 2 pdrs are in the /* Data reference's base object set number, we must assure 2 pdrs are in the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment