Commit 40bf935e by Sebastian Pop Committed by Sebastian Pop

Add a verbosity parameter to clean up the comments of pretty printers.

2010-03-23  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-dependences.c (print_pddr): Call print_pdr with an
	extra argument.
	* graphite-poly.c (debug_pdr): Add an extra argument for the
	verbosity level.
	(print_pdr): Same.
	(print_pbb_domain): Same.
	(print_pbb): Same.
	(print_scop_context): Same.
	(print_scop): Same.
	(print_cloog): Same.
	(debug_pbb_domain): Same.
	(debug_pbb): Same.
	(print_pdrs): Same.
	(debug_pdrs): Same.
	(debug_scop_context): Same.
	(debug_scop): Same.
	(debug_cloog): Same.
	(print_scop_params): Same.
	(debug_scop_params): Same.
	(print_iteration_domain): Same.
	(print_iteration_domains): Same.
	(debug_iteration_domain): Same.
	(debug_iteration_domains): Same.
	(print_scattering_function): Same.
	(print_scattering_functions): Same.
	(debug_scattering_function): Same.
	(debug_scattering_functions): Same.
	* graphite-poly.h (debug_pdr): Update declaration.
	(print_pdr): Same.
	(print_pbb_domain): Same.
	(print_pbb): Same.
	(print_scop_context): Same.
	(print_scop): Same.
	(print_cloog): Same.
	(debug_pbb_domain): Same.
	(debug_pbb): Same.
	(print_pdrs): Same.
	(debug_pdrs): Same.
	(debug_scop_context): Same.
	(debug_scop): Same.
	(debug_cloog): Same.
	(print_scop_params): Same.
	(debug_scop_params): Same.
	(print_iteration_domain): Same.
	(print_iteration_domains): Same.
	(debug_iteration_domain): Same.
	(debug_iteration_domains): Same.
	(print_scattering_function): Same.
	(print_scattering_functions): Same.
	(debug_scattering_function): Same.
	(debug_scattering_functions): Same.

From-SVN: r157888
parent 730a9846
2010-03-23 Sebastian Pop <sebastian.pop@amd.com> 2010-03-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-dependences.c (print_pddr): Call print_pdr with an
extra argument.
* graphite-poly.c (debug_pdr): Add an extra argument for the
verbosity level.
(print_pdr): Same.
(print_pbb_domain): Same.
(print_pbb): Same.
(print_scop_context): Same.
(print_scop): Same.
(print_cloog): Same.
(debug_pbb_domain): Same.
(debug_pbb): Same.
(print_pdrs): Same.
(debug_pdrs): Same.
(debug_scop_context): Same.
(debug_scop): Same.
(debug_cloog): Same.
(print_scop_params): Same.
(debug_scop_params): Same.
(print_iteration_domain): Same.
(print_iteration_domains): Same.
(debug_iteration_domain): Same.
(debug_iteration_domains): Same.
(print_scattering_function): Same.
(print_scattering_functions): Same.
(debug_scattering_function): Same.
(debug_scattering_functions): Same.
* graphite-poly.h (debug_pdr): Update declaration.
(print_pdr): Same.
(print_pbb_domain): Same.
(print_pbb): Same.
(print_scop_context): Same.
(print_scop): Same.
(print_cloog): Same.
(debug_pbb_domain): Same.
(debug_pbb): Same.
(print_pdrs): Same.
(debug_pdrs): Same.
(debug_scop_context): Same.
(debug_scop): Same.
(debug_cloog): Same.
(print_scop_params): Same.
(debug_scop_params): Same.
(print_iteration_domain): Same.
(print_iteration_domains): Same.
(debug_iteration_domain): Same.
(debug_iteration_domains): Same.
(print_scattering_function): Same.
(print_scattering_functions): Same.
(debug_scattering_function): Same.
(debug_scattering_functions): Same.
2010-03-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-poly.c (print_scattering_function_1): New. * graphite-poly.c (print_scattering_function_1): New.
(print_scattering_function): Call it. (print_scattering_function): Call it.
(print_scop_params): Remove spaces at the end of lines. (print_scop_params): Remove spaces at the end of lines.
......
...@@ -184,10 +184,10 @@ print_pddr (FILE *file, poly_ddr_p pddr) ...@@ -184,10 +184,10 @@ print_pddr (FILE *file, poly_ddr_p pddr)
fprintf (file, "has_dependence"); fprintf (file, "has_dependence");
fprintf (file, "\n source "); fprintf (file, "\n source ");
print_pdr (file, PDDR_SOURCE (pddr)); print_pdr (file, PDDR_SOURCE (pddr), 2);
fprintf (file, "\n sink "); fprintf (file, "\n sink ");
print_pdr (file, PDDR_SINK (pddr)); print_pdr (file, PDDR_SINK (pddr), 2);
if (PDDR_KIND (pddr) == has_dependence) if (PDDR_KIND (pddr) == has_dependence)
{ {
......
...@@ -135,13 +135,16 @@ unify_scattering_dimensions (scop_p scop) ...@@ -135,13 +135,16 @@ unify_scattering_dimensions (scop_p scop)
return max_scattering; return max_scattering;
} }
/* Prints to FILE the scattering function of PBB. */ /* Prints to FILE the scattering function of PBB, at some VERBOSITY
level. */
static void static void
print_scattering_function_1 (FILE *file, poly_bb_p pbb) print_scattering_function_1 (FILE *file, poly_bb_p pbb, int verbosity)
{ {
graphite_dim_t i; graphite_dim_t i;
if (verbosity > 0)
{
fprintf (file, "# scattering bb_%d (\n", pbb_index (pbb)); fprintf (file, "# scattering bb_%d (\n", pbb_index (pbb));
fprintf (file, "# eq"); fprintf (file, "# eq");
...@@ -158,6 +161,7 @@ print_scattering_function_1 (FILE *file, poly_bb_p pbb) ...@@ -158,6 +161,7 @@ print_scattering_function_1 (FILE *file, poly_bb_p pbb)
fprintf (file, " p%d", (int) i); fprintf (file, " p%d", (int) i);
fprintf (file, " cst\n"); fprintf (file, " cst\n");
}
/* Number of disjunct components. Remove this when /* Number of disjunct components. Remove this when
PBB_TRANSFORMED_SCATTERING will be a pointset_powerset. */ PBB_TRANSFORMED_SCATTERING will be a pointset_powerset. */
...@@ -166,93 +170,110 @@ print_scattering_function_1 (FILE *file, poly_bb_p pbb) ...@@ -166,93 +170,110 @@ print_scattering_function_1 (FILE *file, poly_bb_p pbb)
? PBB_TRANSFORMED_SCATTERING (pbb) ? PBB_TRANSFORMED_SCATTERING (pbb)
: PBB_ORIGINAL_SCATTERING (pbb)); : PBB_ORIGINAL_SCATTERING (pbb));
if (verbosity > 0)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Prints to FILE the scattering function of PBB. */ /* Prints to FILE the scattering function of PBB, at some VERBOSITY
level. */
void void
print_scattering_function (FILE *file, poly_bb_p pbb) print_scattering_function (FILE *file, poly_bb_p pbb, int verbosity)
{ {
if (!PBB_TRANSFORMED (pbb)) if (!PBB_TRANSFORMED (pbb))
return; return;
if (PBB_TRANSFORMED_SCATTERING (pbb) if (PBB_TRANSFORMED_SCATTERING (pbb)
|| PBB_ORIGINAL_SCATTERING (pbb)) || PBB_ORIGINAL_SCATTERING (pbb))
fprintf (file, "# Scattering function is provided\n1\n"); {
if (verbosity > 0)
fprintf (file, "# Scattering function is provided\n");
fprintf (file, "1\n");
}
else else
{ {
fprintf (file, "# Scattering function is not provided\n0\n"); if (verbosity > 0)
fprintf (file, "# Scattering function is not provided\n");
fprintf (file, "0\n");
return; return;
} }
print_scattering_function_1 (file, pbb); print_scattering_function_1 (file, pbb, verbosity);
} }
/* Prints to FILE the iteration domain of PBB. */ /* Prints to FILE the iteration domain of PBB, at some VERBOSITY
level. */
void void
print_iteration_domain (FILE *file, poly_bb_p pbb) print_iteration_domain (FILE *file, poly_bb_p pbb, int verbosity)
{ {
print_pbb_domain (file, pbb); print_pbb_domain (file, pbb, verbosity);
} }
/* Prints to FILE the scattering functions of every PBB of SCOP. */ /* Prints to FILE the scattering functions of every PBB of SCOP. */
void void
print_scattering_functions (FILE *file, scop_p scop) print_scattering_functions (FILE *file, scop_p scop, int verbosity)
{ {
int i; int i;
poly_bb_p pbb; poly_bb_p pbb;
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++) for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
print_scattering_function (file, pbb); print_scattering_function (file, pbb, verbosity);
} }
/* Prints to FILE the iteration domains of every PBB of SCOP. */ /* Prints to FILE the iteration domains of every PBB of SCOP, at some
VERBOSITY level. */
void void
print_iteration_domains (FILE *file, scop_p scop) print_iteration_domains (FILE *file, scop_p scop, int verbosity)
{ {
int i; int i;
poly_bb_p pbb; poly_bb_p pbb;
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++) for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
print_iteration_domain (file, pbb); print_iteration_domain (file, pbb, verbosity);
} }
/* Prints to STDERR the scattering function of PBB. */ /* Prints to STDERR the scattering function of PBB, at some VERBOSITY
level. */
void void
debug_scattering_function (poly_bb_p pbb) debug_scattering_function (poly_bb_p pbb, int verbosity)
{ {
print_scattering_function (stderr, pbb); print_scattering_function (stderr, pbb, verbosity);
} }
/* Prints to STDERR the iteration domain of PBB. */ /* Prints to STDERR the iteration domain of PBB, at some VERBOSITY
level. */
void void
debug_iteration_domain (poly_bb_p pbb) debug_iteration_domain (poly_bb_p pbb, int verbosity)
{ {
print_iteration_domain (stderr, pbb); print_iteration_domain (stderr, pbb, verbosity);
} }
/* Prints to STDERR the scattering functions of every PBB of SCOP. */ /* Prints to STDERR the scattering functions of every PBB of SCOP, at
some VERBOSITY level. */
void void
debug_scattering_functions (scop_p scop) debug_scattering_functions (scop_p scop, int verbosity)
{ {
print_scattering_functions (stderr, scop); print_scattering_functions (stderr, scop, verbosity);
} }
/* Prints to STDERR the iteration domains of every PBB of SCOP. */ /* Prints to STDERR the iteration domains of every PBB of SCOP, at
some VERBOSITY level. */
void void
debug_iteration_domains (scop_p scop) debug_iteration_domains (scop_p scop, int verbosity)
{ {
print_iteration_domains (stderr, scop); print_iteration_domains (stderr, scop, verbosity);
} }
/* Apply graphite transformations to all the basic blocks of SCOP. */ /* Apply graphite transformations to all the basic blocks of SCOP. */
bool bool
...@@ -428,11 +449,14 @@ print_pdr_access_layout (FILE *file, poly_dr_p pdr) ...@@ -428,11 +449,14 @@ print_pdr_access_layout (FILE *file, poly_dr_p pdr)
fprintf (file, " cst\n"); fprintf (file, " cst\n");
} }
/* Prints to FILE the polyhedral data reference PDR. */ /* Prints to FILE the polyhedral data reference PDR, at some VERBOSITY
level. */
void void
print_pdr (FILE *file, poly_dr_p pdr) print_pdr (FILE *file, poly_dr_p pdr, int verbosity)
{ {
if (verbosity > 1)
{
fprintf (file, "# pdr_%d (", PDR_ID (pdr)); fprintf (file, "# pdr_%d (", PDR_ID (pdr));
switch (PDR_TYPE (pdr)) switch (PDR_TYPE (pdr))
...@@ -454,21 +478,30 @@ print_pdr (FILE *file, poly_dr_p pdr) ...@@ -454,21 +478,30 @@ print_pdr (FILE *file, poly_dr_p pdr)
} }
dump_data_reference (file, (data_reference_p) PDR_CDR (pdr)); dump_data_reference (file, (data_reference_p) PDR_CDR (pdr));
}
if (verbosity > 0)
{
fprintf (file, "# data accesses (\n"); fprintf (file, "# data accesses (\n");
print_pdr_access_layout (file, pdr); print_pdr_access_layout (file, pdr);
}
ppl_print_powerset_matrix (file, PDR_ACCESSES (pdr)); ppl_print_powerset_matrix (file, PDR_ACCESSES (pdr));
if (verbosity > 0)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Prints to STDERR the polyhedral data reference PDR. */ /* Prints to STDERR the polyhedral data reference PDR, at some
VERBOSITY level. */
void void
debug_pdr (poly_dr_p pdr) debug_pdr (poly_dr_p pdr, int verbosity)
{ {
print_pdr (stderr, pdr); print_pdr (stderr, pdr, verbosity);
} }
/* Creates a new SCOP containing REGION. */ /* Creates a new SCOP containing REGION. */
...@@ -514,10 +547,10 @@ free_scop (scop_p scop) ...@@ -514,10 +547,10 @@ free_scop (scop_p scop)
XDELETE (scop); XDELETE (scop);
} }
/* Print to FILE the domain of PBB. */ /* Print to FILE the domain of PBB, at some VERBOSITY level. */
void void
print_pbb_domain (FILE *file, poly_bb_p pbb) print_pbb_domain (FILE *file, poly_bb_p pbb, int verbosity)
{ {
graphite_dim_t i; graphite_dim_t i;
gimple_bb_p gbb = PBB_BLACK_BOX (pbb); gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
...@@ -525,6 +558,8 @@ print_pbb_domain (FILE *file, poly_bb_p pbb) ...@@ -525,6 +558,8 @@ print_pbb_domain (FILE *file, poly_bb_p pbb)
if (!PBB_DOMAIN (pbb)) if (!PBB_DOMAIN (pbb))
return; return;
if (verbosity > 0)
{
fprintf (file, "# Iteration domain of bb_%d (\n", GBB_BB (gbb)->index); fprintf (file, "# Iteration domain of bb_%d (\n", GBB_BB (gbb)->index);
fprintf (file, "# eq"); fprintf (file, "# eq");
...@@ -535,12 +570,14 @@ print_pbb_domain (FILE *file, poly_bb_p pbb) ...@@ -535,12 +570,14 @@ print_pbb_domain (FILE *file, poly_bb_p pbb)
fprintf (file, " p%d", (int) i); fprintf (file, " p%d", (int) i);
fprintf (file, " cst\n"); fprintf (file, " cst\n");
}
if (PBB_DOMAIN (pbb)) if (PBB_DOMAIN (pbb))
ppl_print_powerset_matrix (file, PBB_DOMAIN (pbb)); ppl_print_powerset_matrix (file, PBB_DOMAIN (pbb));
else else
fprintf (file, "0\n"); fprintf (file, "0\n");
if (verbosity > 0)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
...@@ -598,10 +635,11 @@ dump_gbb_conditions (FILE *file, gimple_bb_p gbb) ...@@ -598,10 +635,11 @@ dump_gbb_conditions (FILE *file, gimple_bb_p gbb)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Print to FILE all the data references of PBB. */ /* Print to FILE all the data references of PBB, at some VERBOSITY
level. */
void void
print_pdrs (FILE *file, poly_bb_p pbb) print_pdrs (FILE *file, poly_bb_p pbb, int verbosity)
{ {
int i; int i;
poly_dr_p pdr; poly_dr_p pdr;
...@@ -610,12 +648,18 @@ print_pdrs (FILE *file, poly_bb_p pbb) ...@@ -610,12 +648,18 @@ print_pdrs (FILE *file, poly_bb_p pbb)
if (VEC_length (poly_dr_p, PBB_DRS (pbb)) == 0) if (VEC_length (poly_dr_p, PBB_DRS (pbb)) == 0)
{ {
fprintf (file, "# Access informations are not provided\n0\n"); if (verbosity > 0)
fprintf (file, "# Access informations are not provided\n");\
fprintf (file, "0\n");
return; return;
} }
if (verbosity > 1)
fprintf (file, "# Data references (\n"); fprintf (file, "# Data references (\n");
fprintf (file, "# Access informations are provided\n1\n");
if (verbosity > 0)
fprintf (file, "# Access informations are provided\n");
fprintf (file, "1\n");
for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++) for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)
if (PDR_TYPE (pdr) == PDR_READ) if (PDR_TYPE (pdr) == PDR_READ)
...@@ -623,89 +667,143 @@ print_pdrs (FILE *file, poly_bb_p pbb) ...@@ -623,89 +667,143 @@ print_pdrs (FILE *file, poly_bb_p pbb)
else else
nb_writes++; nb_writes++;
if (verbosity > 1)
fprintf (file, "# Read data references (\n"); fprintf (file, "# Read data references (\n");
fprintf (file, "# Read access informations\n%d\n", nb_reads);
if (verbosity > 0)
fprintf (file, "# Read access informations\n");
fprintf (file, "%d\n", nb_reads);
for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++) for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)
if (PDR_TYPE (pdr) == PDR_READ) if (PDR_TYPE (pdr) == PDR_READ)
print_pdr (file, pdr); print_pdr (file, pdr, verbosity);
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
if (verbosity > 1)
fprintf (file, "# Write data references (\n"); fprintf (file, "# Write data references (\n");
fprintf (file, "# Write access informations\n%d\n", nb_writes);
if (verbosity > 0)
fprintf (file, "# Write access informations\n");
fprintf (file, "%d\n", nb_writes);
for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++) for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)
if (PDR_TYPE (pdr) != PDR_READ) if (PDR_TYPE (pdr) != PDR_READ)
print_pdr (file, pdr); print_pdr (file, pdr, verbosity);
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Print to STDERR all the data references of PBB. */ /* Print to STDERR all the data references of PBB. */
void void
debug_pdrs (poly_bb_p pbb) debug_pdrs (poly_bb_p pbb, int verbosity)
{ {
print_pdrs (stderr, pbb); print_pdrs (stderr, pbb, verbosity);
} }
/* Print to FILE the body of PBB. */ /* Print to FILE the body of PBB, at some VERBOSITY level. */
static void static void
print_pbb_body (FILE *file, poly_bb_p pbb) print_pbb_body (FILE *file, poly_bb_p pbb, int verbosity)
{ {
if (verbosity > 1)
fprintf (file, "# Body (\n"); fprintf (file, "# Body (\n");
fprintf (file, "# Statement body is provided\n1\n");
if (verbosity > 0)
fprintf (file, "# Statement body is provided\n");
fprintf (file, "1\n");
if (verbosity > 0)
fprintf (file, "# Original iterator names\n# Iterator names are not provided yet.\n"); fprintf (file, "# Original iterator names\n# Iterator names are not provided yet.\n");
if (verbosity > 0)
fprintf (file, "# Statement body\n"); fprintf (file, "# Statement body\n");
fprintf (file, "{\n"); fprintf (file, "{\n");
dump_bb (pbb_bb (pbb), file, 0); dump_bb (pbb_bb (pbb), file, 0);
fprintf (file, "}\n"); fprintf (file, "}\n");
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Print to FILE the domain and scattering function of PBB. */ /* Print to FILE the domain and scattering function of PBB, at some
VERBOSITY level. */
void void
print_pbb (FILE *file, poly_bb_p pbb) print_pbb (FILE *file, poly_bb_p pbb, int verbosity)
{ {
if (verbosity > 1)
{
fprintf (file, "# pbb_%d (\n", pbb_index (pbb)); fprintf (file, "# pbb_%d (\n", pbb_index (pbb));
dump_gbb_conditions (file, PBB_BLACK_BOX (pbb)); dump_gbb_conditions (file, PBB_BLACK_BOX (pbb));
dump_gbb_cases (file, PBB_BLACK_BOX (pbb)); dump_gbb_cases (file, PBB_BLACK_BOX (pbb));
print_pbb_domain (file, pbb); }
print_scattering_function (file, pbb);
print_pdrs (file, pbb); print_pbb_domain (file, pbb, verbosity);
print_pbb_body (file, pbb); print_scattering_function (file, pbb, verbosity);
print_pdrs (file, pbb, verbosity);
print_pbb_body (file, pbb, verbosity);
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Print to FILE the parameters of SCOP. */ /* Print to FILE the parameters of SCOP, at some VERBOSITY level. */
void void
print_scop_params (FILE *file, scop_p scop) print_scop_params (FILE *file, scop_p scop, int verbosity)
{ {
int i; int i;
tree t; tree t;
if (verbosity > 1)
fprintf (file, "# parameters (\n"); fprintf (file, "# parameters (\n");
if (VEC_length (tree, SESE_PARAMS (SCOP_REGION (scop)))) if (VEC_length (tree, SESE_PARAMS (SCOP_REGION (scop))))
fprintf (file, "# Parameter names are provided\n1\n# Parameter names\n"); {
if (verbosity > 0)
fprintf (file, "# Parameter names are provided\n");
fprintf (file, "1\n");
if (verbosity > 0)
fprintf (file, "# Parameter names\n");
}
else else
fprintf (file, "# Parameter names are not provided\n0\n"); {
if (verbosity > 0)
fprintf (file, "# Parameter names are not provided\n");
fprintf (file, "0\n");
}
for (i = 0; VEC_iterate (tree, SESE_PARAMS (SCOP_REGION (scop)), i, t); i++) for (i = 0; VEC_iterate (tree, SESE_PARAMS (SCOP_REGION (scop)), i, t); i++)
{ {
print_generic_expr (file, t, 0); print_generic_expr (file, t, 0);
fprintf (file, " "); fprintf (file, " ");
} }
fprintf (file, "\n");
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Print to FILE the context of SCoP. */ /* Print to FILE the context of SCoP, at some VERBOSITY level. */
void void
print_scop_context (FILE *file, scop_p scop) print_scop_context (FILE *file, scop_p scop, int verbosity)
{ {
graphite_dim_t i; graphite_dim_t i;
if (verbosity > 0)
{
fprintf (file, "# Context (\n"); fprintf (file, "# Context (\n");
fprintf (file, "# eq"); fprintf (file, "# eq");
...@@ -713,33 +811,40 @@ print_scop_context (FILE *file, scop_p scop) ...@@ -713,33 +811,40 @@ print_scop_context (FILE *file, scop_p scop)
fprintf (file, " p%d", (int) i); fprintf (file, " p%d", (int) i);
fprintf (file, " cst\n"); fprintf (file, " cst\n");
}
if (SCOP_CONTEXT (scop)) if (SCOP_CONTEXT (scop))
ppl_print_powerset_matrix (file, SCOP_CONTEXT (scop)); ppl_print_powerset_matrix (file, SCOP_CONTEXT (scop));
else else
fprintf (file, "0 %d\n", (int) scop_nb_params (scop) + 2); fprintf (file, "0 %d\n", (int) scop_nb_params (scop) + 2);
if (verbosity > 0)
fprintf (file, "# )\n"); fprintf (file, "# )\n");
} }
/* Print to FILE the SCOP. */ /* Print to FILE the SCOP, at some VERBOSITY level. */
void void
print_scop (FILE *file, scop_p scop) print_scop (FILE *file, scop_p scop, int verbosity)
{ {
int i; int i;
poly_bb_p pbb; poly_bb_p pbb;
fprintf (file, "SCoP #(\n"); fprintf (file, "SCoP #(\n");
fprintf (file, "# Language\nGimple\n"); fprintf (file, "# Language\nGimple\n");
print_scop_context (file, scop); print_scop_context (file, scop, verbosity);
print_scop_params (file, scop); print_scop_params (file, scop, verbosity);
fprintf (file, "# Number of statements\n%d\n",
VEC_length (poly_bb_p, SCOP_BBS (scop))); if (verbosity > 0)
fprintf (file, "# Number of statements\n");
fprintf (file, "%d\n",VEC_length (poly_bb_p, SCOP_BBS (scop)));
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++) for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
print_pbb (file, pbb); print_pbb (file, pbb, verbosity);
if (verbosity > 1)
{
fprintf (file, "# original_lst (\n"); fprintf (file, "# original_lst (\n");
print_lst (file, SCOP_ORIGINAL_SCHEDULE (scop), 0); print_lst (file, SCOP_ORIGINAL_SCHEDULE (scop), 0);
fprintf (file, "\n#)\n"); fprintf (file, "\n#)\n");
...@@ -747,36 +852,60 @@ print_scop (FILE *file, scop_p scop) ...@@ -747,36 +852,60 @@ print_scop (FILE *file, scop_p scop)
fprintf (file, "# transformed_lst (\n"); fprintf (file, "# transformed_lst (\n");
print_lst (file, SCOP_TRANSFORMED_SCHEDULE (scop), 0); print_lst (file, SCOP_TRANSFORMED_SCHEDULE (scop), 0);
fprintf (file, "\n#)\n"); fprintf (file, "\n#)\n");
}
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Print to FILE the input file that CLooG would expect as input. */ /* Print to FILE the input file that CLooG would expect as input, at
some VERBOSITY level. */
void void
print_cloog (FILE *file, scop_p scop) print_cloog (FILE *file, scop_p scop, int verbosity)
{ {
int i; int i;
poly_bb_p pbb; poly_bb_p pbb;
fprintf (file, "# SCoP (generated by GCC/Graphite\n"); fprintf (file, "# SCoP (generated by GCC/Graphite\n");
fprintf (file, "# CLooG output language\nc\n"); if (verbosity > 0)
print_scop_context (file, scop); fprintf (file, "# CLooG output language\n");
print_scop_params (file, scop); fprintf (file, "c\n");
fprintf (file, "# Number of statements\n%d\n",
VEC_length (poly_bb_p, SCOP_BBS (scop))); print_scop_context (file, scop, verbosity);
print_scop_params (file, scop, verbosity);
if (verbosity > 0)
fprintf (file, "# Number of statements\n");
fprintf (file, "%d\n", VEC_length (poly_bb_p, SCOP_BBS (scop)));
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++) for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
{ {
if (verbosity > 1)
fprintf (file, "# pbb_%d (\n", pbb_index (pbb)); fprintf (file, "# pbb_%d (\n", pbb_index (pbb));
print_pbb_domain (file, pbb);
fprintf (file, "0 0 0 # For future CLooG options.\n#)\n"); print_pbb_domain (file, pbb, verbosity);
fprintf (file, "0 0 0");
if (verbosity > 0)
fprintf (file, "# For future CLooG options.\n");
else
fprintf (file, "\n");
if (verbosity > 1)
fprintf (file, "#)\n");
} }
fprintf (file, "0 # Don't set the iterator names.\n"); fprintf (file, "0");
if (verbosity > 0)
fprintf (file, "# Don't set the iterator names.\n");
else
fprintf (file, "\n");
if (verbosity > 0)
fprintf (file, "# Number of scattering functions\n");
fprintf (file, "# Number of scattering functions\n%d\n", fprintf (file, "%d\n", VEC_length (poly_bb_p, SCOP_BBS (scop)));
VEC_length (poly_bb_p, SCOP_BBS (scop)));
unify_scattering_dimensions (scop); unify_scattering_dimensions (scop);
for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++) for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb); i++)
...@@ -786,61 +915,73 @@ print_cloog (FILE *file, scop_p scop) ...@@ -786,61 +915,73 @@ print_cloog (FILE *file, scop_p scop)
|| PBB_ORIGINAL_SCATTERING (pbb))) || PBB_ORIGINAL_SCATTERING (pbb)))
continue; continue;
if (verbosity > 1)
fprintf (file, "# pbb_%d (\n", pbb_index (pbb)); fprintf (file, "# pbb_%d (\n", pbb_index (pbb));
print_scattering_function_1 (file, pbb);
print_scattering_function_1 (file, pbb, verbosity);
if (verbosity > 1)
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
fprintf (file, "0 # Don't set the scattering dimension names.\n"); fprintf (file, "0");
if (verbosity > 0)
fprintf (file, "# Don't set the scattering dimension names.\n");
else
fprintf (file, "\n");
fprintf (file, "#)\n"); fprintf (file, "#)\n");
} }
/* Print to STDERR the domain of PBB. */ /* Print to STDERR the domain of PBB, at some VERBOSITY level. */
void void
debug_pbb_domain (poly_bb_p pbb) debug_pbb_domain (poly_bb_p pbb, int verbosity)
{ {
print_pbb_domain (stderr, pbb); print_pbb_domain (stderr, pbb, verbosity);
} }
/* Print to FILE the domain and scattering function of PBB. */ /* Print to FILE the domain and scattering function of PBB, at some
VERBOSITY level. */
void void
debug_pbb (poly_bb_p pbb) debug_pbb (poly_bb_p pbb, int verbosity)
{ {
print_pbb (stderr, pbb); print_pbb (stderr, pbb, verbosity);
} }
/* Print to STDERR the context of SCOP. */ /* Print to STDERR the context of SCOP, at some VERBOSITY level. */
void void
debug_scop_context (scop_p scop) debug_scop_context (scop_p scop, int verbosity)
{ {
print_scop_context (stderr, scop); print_scop_context (stderr, scop, verbosity);
} }
/* Print to STDERR the SCOP. */ /* Print to STDERR the SCOP, at some VERBOSITY level. */
void void
debug_scop (scop_p scop) debug_scop (scop_p scop, int verbosity)
{ {
print_scop (stderr, scop); print_scop (stderr, scop, verbosity);
} }
/* Print to STDERR the SCOP under CLooG format. */ /* Print to STDERR the SCOP under CLooG format, at some VERBOSITY
level. */
void void
debug_cloog (scop_p scop) debug_cloog (scop_p scop, int verbosity)
{ {
print_cloog (stderr, scop); print_cloog (stderr, scop, verbosity);
} }
/* Print to STDERR the parameters of SCOP. */ /* Print to STDERR the parameters of SCOP, at some VERBOSITY
level. */
void void
debug_scop_params (scop_p scop) debug_scop_params (scop_p scop, int verbosity)
{ {
print_scop_params (stderr, scop); print_scop_params (stderr, scop, verbosity);
} }
......
...@@ -155,8 +155,8 @@ struct poly_dr ...@@ -155,8 +155,8 @@ struct poly_dr
void new_poly_dr (poly_bb_p, int, ppl_Pointset_Powerset_C_Polyhedron_t, void new_poly_dr (poly_bb_p, int, ppl_Pointset_Powerset_C_Polyhedron_t,
enum poly_dr_type, void *, graphite_dim_t); enum poly_dr_type, void *, graphite_dim_t);
void free_poly_dr (poly_dr_p); void free_poly_dr (poly_dr_p);
void debug_pdr (poly_dr_p); void debug_pdr (poly_dr_p, int);
void print_pdr (FILE *, poly_dr_p); void print_pdr (FILE *, poly_dr_p, int);
static inline scop_p pdr_scop (poly_dr_p pdr); static inline scop_p pdr_scop (poly_dr_p pdr);
/* The dimension of the PDR_ACCESSES polyhedron of PDR. */ /* The dimension of the PDR_ACCESSES polyhedron of PDR. */
...@@ -346,24 +346,24 @@ extern void new_poly_bb (scop_p, void *, bool); ...@@ -346,24 +346,24 @@ extern void new_poly_bb (scop_p, void *, bool);
extern void free_poly_bb (poly_bb_p); extern void free_poly_bb (poly_bb_p);
extern void debug_loop_vec (poly_bb_p); extern void debug_loop_vec (poly_bb_p);
extern void schedule_to_scattering (poly_bb_p, int); extern void schedule_to_scattering (poly_bb_p, int);
extern void print_pbb_domain (FILE *, poly_bb_p); extern void print_pbb_domain (FILE *, poly_bb_p, int);
extern void print_pbb (FILE *, poly_bb_p); extern void print_pbb (FILE *, poly_bb_p, int);
extern void print_scop_context (FILE *, scop_p); extern void print_scop_context (FILE *, scop_p, int);
extern void print_scop (FILE *, scop_p); extern void print_scop (FILE *, scop_p, int);
extern void print_cloog (FILE *, scop_p); extern void print_cloog (FILE *, scop_p, int);
extern void debug_pbb_domain (poly_bb_p); extern void debug_pbb_domain (poly_bb_p, int);
extern void debug_pbb (poly_bb_p); extern void debug_pbb (poly_bb_p, int);
extern void print_pdrs (FILE *, poly_bb_p); extern void print_pdrs (FILE *, poly_bb_p, int);
extern void debug_pdrs (poly_bb_p); extern void debug_pdrs (poly_bb_p, int);
extern void debug_scop_context (scop_p); extern void debug_scop_context (scop_p, int);
extern void debug_scop (scop_p); extern void debug_scop (scop_p, int);
extern void debug_cloog (scop_p); extern void debug_cloog (scop_p, int);
extern void print_scop_params (FILE *, scop_p); extern void print_scop_params (FILE *, scop_p, int);
extern void debug_scop_params (scop_p); extern void debug_scop_params (scop_p, int);
extern void print_iteration_domain (FILE *, poly_bb_p); extern void print_iteration_domain (FILE *, poly_bb_p, int);
extern void print_iteration_domains (FILE *, scop_p); extern void print_iteration_domains (FILE *, scop_p, int);
extern void debug_iteration_domain (poly_bb_p); extern void debug_iteration_domain (poly_bb_p, int);
extern void debug_iteration_domains (scop_p); extern void debug_iteration_domains (scop_p, int);
extern bool scop_do_interchange (scop_p); extern bool scop_do_interchange (scop_p);
extern bool scop_do_strip_mine (scop_p); extern bool scop_do_strip_mine (scop_p);
extern bool scop_do_block (scop_p); extern bool scop_do_block (scop_p);
...@@ -1338,10 +1338,10 @@ extern void free_scop (scop_p); ...@@ -1338,10 +1338,10 @@ extern void free_scop (scop_p);
extern void free_scops (VEC (scop_p, heap) *); extern void free_scops (VEC (scop_p, heap) *);
extern void print_generated_program (FILE *, scop_p); extern void print_generated_program (FILE *, scop_p);
extern void debug_generated_program (scop_p); extern void debug_generated_program (scop_p);
extern void print_scattering_function (FILE *, poly_bb_p); extern void print_scattering_function (FILE *, poly_bb_p, int);
extern void print_scattering_functions (FILE *, scop_p); extern void print_scattering_functions (FILE *, scop_p, int);
extern void debug_scattering_function (poly_bb_p); extern void debug_scattering_function (poly_bb_p, int);
extern void debug_scattering_functions (scop_p); extern void debug_scattering_functions (scop_p, int);
extern int scop_max_loop_depth (scop_p); extern int scop_max_loop_depth (scop_p);
extern int unify_scattering_dimensions (scop_p); extern int unify_scattering_dimensions (scop_p);
extern bool apply_poly_transforms (scop_p); extern bool apply_poly_transforms (scop_p);
......
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