aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-poly.c
diff options
context:
space:
mode:
authorSebastian Pop <s.pop@samsung.com>2015-08-27 19:07:04 +0000
committerSebastian Pop <spop@gcc.gnu.org>2015-08-27 19:07:04 +0000
commitd6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226 (patch)
tree880a7c9f5b8523640dba320e719c4decf87758ed /gcc/graphite-poly.c
parent31da952a49ef2861ee35786a3e41865ac259599c (diff)
downloadgcc-d6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226.zip
gcc-d6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226.tar.gz
gcc-d6bb5ccfebfc29ea2a583fa3fb0d0ffd48e0e226.tar.bz2
remove -floop-* flags
2015-08-27 Sebastian Pop <s.pop@samsung.com> * Makefile.in (OBJS): Remove graphite-blocking.o and graphite-interchange.o. * common.opt (floop-strip-mine, floop-interchange, floop-block): Alias of floop-nest-optimize. * doc/invoke.texi (floop-strip-mine, floop-interchange, floop-block): Document as alias of -floop-nest-optimize. * graphite-blocking.c: Remove. * graphite-interchange.c: Remove. * graphite-optimize-isl.c: Include dumpfile.h. (getScheduleForBand): Add dump for tiled loops. Use PARAM_LOOP_BLOCK_TILE_SIZE instead of hard coded constant. * graphite-poly.c (scop_max_loop_depth): Remove. (print_scattering_function_1): Remove. (print_scattering_function): Remove. (print_scattering_functions): Remove. (debug_scattering_function): Remove. (debug_scattering_functions): Remove. (apply_poly_transforms): Remove use of flag_loop_block, flag_loop_strip_mine, and flag_loop_interchange. (new_poly_bb): Remove use of PBB_TRANSFORMED, PBB_SAVED, and PBB_ORIGINAL. (print_pdr_access_layout): Remove. (print_pdr): Print ISL representation. (new_scop): Remove use of SCOP_ORIGINAL_SCHEDULE, SCOP_TRANSFORMED_SCHEDULE, and SCOP_SAVED_SCHEDULE. (free_scop): Same. (openscop_print_pbb_domain): Remove. (print_pbb): Remove call to print_scattering_function. (openscop_print_scop_context): Remove. (print_scop_context): Do not print matrices anymore. (print_scop): Do not print SCOP_ORIGINAL_SCHEDULE and SCOP_TRANSFORMED_SCHEDULE. (print_isl_set): Add printing of a new line. (print_isl_map): Same. (print_isl_aff): Same. (print_isl_constraint): Same. (loop_to_lst): Remove. (scop_to_lst): Remove. (lst_indent_to): Remove. (print_lst): Remove. (debug_lst): Remove. (dot_lst_1): Remove. (dot_lst): Remove. (reverse_loop_at_level): Remove. (reverse_loop_for_pbbs): Remove. * graphite-poly.h (pdr_dim_iter_domain): Remove. (pdr_nb_params): Remove. (pdr_alias_set_dim): Remove. (pdr_subscript_dim): Remove. (pdr_iterator_dim): Remove. (pdr_parameter_dim): Remove. (same_pdr_p): Remove. (struct poly_scattering): Remove. (struct poly_bb): Remove _original, _transformed, _saved. (PBB_DOMAIN, PBB_ORIGINAL, PBB_ORIGINAL_SCATTERING): Remove. (PBB_TRANSFORMED, PBB_TRANSFORMED_SCATTERING, PBB_SAVED): Remove. (PBB_NB_LOCAL_VARIABLES): Remove. (PBB_NB_SCATTERING_TRANSFORM): Remove. (schedule_to_scattering): Remove. (number_of_write_pdrs): Remove. (pbb_dim_iter_domain): Remove. (pbb_nb_params): Remove. (pbb_nb_scattering_orig): Remove. (pbb_nb_scattering_transform): Remove. (pbb_nb_dynamic_scattering_transform): Remove. (pbb_nb_local_vars): Remove. (pbb_iterator_dim): Remove. (pbb_parameter_dim): Remove. (psco_scattering_dim): Remove. (psct_scattering_dim): Remove. (psct_local_var_dim): Remove. (psco_iterator_dim): Remove. (psct_iterator_dim): Remove. (psco_parameter_dim): Remove. (psct_parameter_dim): Remove. (psct_dynamic_dim): Remove. (psct_static_dim): Remove. (psct_add_local_variable): Remove. (new_lst_loop): Remove. (new_lst_stmt): Remove. (free_lst): Remove. (copy_lst): Remove. (lst_add_loop_under_loop): Remove. (lst_depth): Remove. (lst_dewey_number): Remove. (lst_dewey_number_at_depth): Remove. (lst_pred): Remove. (lst_succ): Remove. (lst_find_pbb): Remove. (find_lst_loop): Remove. (lst_find_first_pbb): Remove. (lst_empty_p): Remove. (lst_find_last_pbb): Remove. (lst_contains_p): Remove. (lst_contains_pbb): Remove. (lst_create_nest): Remove. (lst_remove_from_sequence): Remove. (lst_remove_loop_and_inline_stmts_in_loop_father): Remove. (lst_niter_for_loop): Remove. (pbb_update_scattering): Remove. (lst_update_scattering_under): Remove. (lst_update_scattering): Remove. (lst_insert_in_sequence): Remove. (lst_replace): Remove. (lst_substitute_3): Remove. (lst_distribute_lst): Remove. (lst_remove_all_before_including_pbb): Remove. (lst_remove_all_before_excluding_pbb): Remove. (struct scop): Remove original_schedule, transformed_schedule, and saved_schedule. (SCOP_ORIGINAL_SCHEDULE, SCOP_TRANSFORMED_SCHEDULE): Remove. (SCOP_SAVED_SCHEDULE): Remove. (poly_scattering_new): Remove. (poly_scattering_free): Remove. (poly_scattering_copy): Remove. (store_scattering_pbb): Remove. (store_lst_schedule): Remove. (restore_lst_schedule): Remove. (store_scattering): Remove. (restore_scattering_pbb): Remove. (restore_scattering): Remove. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove scattering_dimensions. Do not use pbb_dim_iter_domain: compute the scattering polyhedron dimension from the dimension of pbb->domain. (build_scop_scattering): Update call to build_pbb_scattering_polyhedrons. (build_poly_scop): Remove call to scop_to_lst. * graphite.c (graphite_transform_loops): Add call to print_scop. (gate_graphite_transforms): Remove use of flag_loop_block, flag_loop_interchange, and flag_loop_strip_mine. testsuite/ * gcc.dg/graphite/graphite.exp (interchange_files, block_files): Replaced by opt_files, compile with -floop-nest-optimize. * g++.dg/graphite/graphite.exp: Same. * gfortran.dg/graphite/graphite.exp: Same. * gcc.dg/graphite/block-0.c: Adjust pattern. * gcc.dg/graphite/block-1.c: Same. * gcc.dg/graphite/block-3.c: Same. * gcc.dg/graphite/block-4.c: Same. * gcc.dg/graphite/block-5.c: Same. * gcc.dg/graphite/block-6.c: Same. * gcc.dg/graphite/block-7.c: Same. * gcc.dg/graphite/block-8.c: Same. * gcc.dg/graphite/block-pr47654.c: Same. * gcc.dg/graphite/interchange-0.c: Same. * gcc.dg/graphite/interchange-1.c: Same. * gcc.dg/graphite/interchange-10.c: Same. * gcc.dg/graphite/interchange-11.c: Same. * gcc.dg/graphite/interchange-12.c: Same. * gcc.dg/graphite/interchange-13.c: Same. * gcc.dg/graphite/interchange-14.c: Same. * gcc.dg/graphite/interchange-15.c: Same. * gcc.dg/graphite/interchange-3.c: Same. * gcc.dg/graphite/interchange-4.c: Same. * gcc.dg/graphite/interchange-5.c: Same. * gcc.dg/graphite/interchange-6.c: Same. * gcc.dg/graphite/interchange-7.c: Same. * gcc.dg/graphite/interchange-8.c: Same. * gcc.dg/graphite/interchange-9.c: Same. * gcc.dg/graphite/interchange-mvt.c: Same. * gcc.dg/graphite/pr37485.c: Same. * gcc.dg/graphite/uns-block-1.c: Same. * gcc.dg/graphite/uns-interchange-12.c: Same. * gcc.dg/graphite/uns-interchange-14.c: Same. * gcc.dg/graphite/uns-interchange-15.c: Same. * gcc.dg/graphite/uns-interchange-9.c: Same. * gcc.dg/graphite/uns-interchange-mvt.c: Same. * gfortran.dg/graphite/interchange-3.f90: Same. From-SVN: r227277
Diffstat (limited to 'gcc/graphite-poly.c')
-rw-r--r--gcc/graphite-poly.c490
1 files changed, 11 insertions, 479 deletions
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 7ea9389..98e8ab0 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -69,94 +69,6 @@ debug_gmp_value (mpz_t val)
gmp_fprintf (stderr, "%Zd", val);
}
-/* Return the maximal loop depth in SCOP. */
-
-int
-scop_max_loop_depth (scop_p scop)
-{
- int i;
- poly_bb_p pbb;
- int max_nb_loops = 0;
-
- FOR_EACH_VEC_ELT (SCOP_BBS (scop), i, pbb)
- {
- int nb_loops = pbb_dim_iter_domain (pbb);
- if (max_nb_loops < nb_loops)
- max_nb_loops = nb_loops;
- }
-
- return max_nb_loops;
-}
-
-/* Prints to FILE the scattering function of PBB, at some VERBOSITY
- level. */
-
-static void
-print_scattering_function_1 (FILE *file, poly_bb_p pbb, int verbosity)
-{
- graphite_dim_t i;
-
- if (verbosity > 0)
- {
- fprintf (file, "# scattering bb_%d (\n", pbb_index (pbb));
- fprintf (file, "#eq");
-
- for (i = 0; i < pbb_nb_scattering_transform (pbb); i++)
- fprintf (file, " s%d", (int) i);
-
- for (i = 0; i < pbb_nb_local_vars (pbb); i++)
- fprintf (file, " lv%d", (int) i);
-
- for (i = 0; i < pbb_dim_iter_domain (pbb); i++)
- fprintf (file, " i%d", (int) i);
-
- for (i = 0; i < pbb_nb_params (pbb); i++)
- fprintf (file, " p%d", (int) i);
-
- fprintf (file, " cst\n");
- }
-
- fprintf (file, "isl\n");
- print_isl_map (file, pbb->transformed ? pbb->transformed : pbb->schedule);
-
- if (verbosity > 0)
- fprintf (file, "#)\n");
-}
-
-/* Prints to FILE the scattering function of PBB, at some VERBOSITY
- level. */
-
-void
-print_scattering_function (FILE *file, poly_bb_p pbb, int verbosity)
-{
- if (!PBB_TRANSFORMED (pbb))
- return;
-
- if (pbb->schedule || pbb->transformed)
- {
- if (verbosity > 0)
- fprintf (file, "# Scattering function is provided\n");
-
- fprintf (file, "1\n");
- }
- else
- {
- if (verbosity > 0)
- fprintf (file, "# Scattering function is not provided\n");
-
- fprintf (file, "0\n");
- return;
- }
-
- print_scattering_function_1 (file, pbb, verbosity);
-
- if (verbosity > 0)
- fprintf (file, "# Scattering names are not provided\n");
-
- fprintf (file, "0\n");
-
-}
-
/* Prints to FILE the iteration domain of PBB, at some VERBOSITY
level. */
@@ -166,18 +78,6 @@ print_iteration_domain (FILE *file, poly_bb_p pbb, int verbosity)
print_pbb_domain (file, pbb, verbosity);
}
-/* Prints to FILE the scattering functions of every PBB of SCOP. */
-
-void
-print_scattering_functions (FILE *file, scop_p scop, int verbosity)
-{
- int i;
- poly_bb_p pbb;
-
- FOR_EACH_VEC_ELT (SCOP_BBS (scop), i, pbb)
- print_scattering_function (file, pbb, verbosity);
-}
-
/* Prints to FILE the iteration domains of every PBB of SCOP, at some
VERBOSITY level. */
@@ -191,15 +91,6 @@ print_iteration_domains (FILE *file, scop_p scop, int verbosity)
print_iteration_domain (file, pbb, verbosity);
}
-/* Prints to STDERR the scattering function of PBB, at some VERBOSITY
- level. */
-
-DEBUG_FUNCTION void
-debug_scattering_function (poly_bb_p pbb, int verbosity)
-{
- print_scattering_function (stderr, pbb, verbosity);
-}
-
/* Prints to STDERR the iteration domain of PBB, at some VERBOSITY
level. */
@@ -209,15 +100,6 @@ debug_iteration_domain (poly_bb_p pbb, int verbosity)
print_iteration_domain (stderr, pbb, verbosity);
}
-/* Prints to STDERR the scattering functions of every PBB of SCOP, at
- some VERBOSITY level. */
-
-DEBUG_FUNCTION void
-debug_scattering_functions (scop_p scop, int verbosity)
-{
- print_scattering_functions (stderr, scop, verbosity);
-}
-
/* Prints to STDERR the iteration domains of every PBB of SCOP, at
some VERBOSITY level. */
@@ -236,28 +118,13 @@ apply_poly_transforms (scop_p scop)
/* Generate code even if we did not apply any real transformation.
This also allows to check the performance for the identity
- transformation: GIMPLE -> GRAPHITE -> GIMPLE
- Keep in mind that CLooG optimizes in control, so the loop structure
- may change, even if we only use -fgraphite-identity. */
+ transformation: GIMPLE -> GRAPHITE -> GIMPLE. */
if (flag_graphite_identity)
transform_done = true;
if (flag_loop_parallelize_all)
transform_done = true;
- if (flag_loop_block)
- transform_done |= scop_do_block (scop);
- else
- {
- if (flag_loop_strip_mine)
- transform_done |= scop_do_strip_mine (scop, 0);
-
- if (flag_loop_interchange)
- transform_done |= scop_do_interchange (scop);
- }
-
- /* This pass needs to be run at the final stage, as it does not
- update the lst. */
if (flag_loop_optimize_isl)
transform_done |= optimize_isl (scop);
@@ -311,9 +178,6 @@ new_poly_bb (scop_p scop, void *black_box)
pbb->saved = NULL;
PBB_SCOP (pbb) = scop;
pbb_set_black_box (pbb, black_box);
- PBB_TRANSFORMED (pbb) = NULL;
- PBB_SAVED (pbb) = NULL;
- PBB_ORIGINAL (pbb) = NULL;
PBB_DRS (pbb).create (3);
PBB_IS_REDUCTION (pbb) = false;
GBB_PBB ((gimple_bb_p) black_box) = pbb;
@@ -342,27 +206,6 @@ free_poly_bb (poly_bb_p pbb)
XDELETE (pbb);
}
-static void
-print_pdr_access_layout (FILE *file, poly_bb_p pbb, poly_dr_p pdr)
-{
- graphite_dim_t i;
-
- fprintf (file, "# eq");
-
- fprintf (file, " alias");
-
- for (i = 0; i < PDR_NB_SUBSCRIPTS (pdr); i++)
- fprintf (file, " sub%d", (int) i);
-
- for (i = 0; i < pbb_dim_iter_domain (pbb); i++)
- fprintf (file, " i%d", (int) i);
-
- for (i = 0; i < pbb_nb_params (pbb); i++)
- fprintf (file, " p%d", (int) i);
-
- fprintf (file, " cst\n");
-}
-
/* Prints to FILE the polyhedral data reference PDR, at some VERBOSITY
level. */
@@ -397,14 +240,10 @@ print_pdr (FILE *file, poly_dr_p pdr, int verbosity)
if (verbosity > 0)
{
fprintf (file, "# data accesses (\n");
- print_pdr_access_layout (file, PDR_PBB (pdr), pdr);
+ print_isl_map (file, pdr->accesses);
+ print_isl_set (file, pdr->subscript_sizes);
+ fprintf (file, "#)\n");
}
-
- /* XXX isl dump accesses/subscripts */
-
- if (verbosity > 0)
- fprintf (file, "#)\n");
-
if (verbosity > 1)
fprintf (file, "#)\n");
}
@@ -440,9 +279,6 @@ new_scop (sese region)
scop->may_waw_no_source = NULL;
scop_set_region (scop, region);
SCOP_BBS (scop).create (3);
- SCOP_ORIGINAL_SCHEDULE (scop) = NULL;
- SCOP_TRANSFORMED_SCHEDULE (scop) = NULL;
- SCOP_SAVED_SCHEDULE (scop) = NULL;
POLY_SCOP_P (scop) = false;
return scop;
@@ -474,44 +310,9 @@ free_scop (scop_p scop)
isl_union_map_free (scop->may_waw);
isl_union_map_free (scop->must_waw_no_source);
isl_union_map_free (scop->may_waw_no_source);
- free_lst (SCOP_ORIGINAL_SCHEDULE (scop));
- free_lst (SCOP_TRANSFORMED_SCHEDULE (scop));
- free_lst (SCOP_SAVED_SCHEDULE (scop));
XDELETE (scop);
}
-/* Print to FILE the domain of PBB in OpenScop format, at some VERBOSITY
- level. */
-
-static void
-openscop_print_pbb_domain (FILE *file, poly_bb_p pbb, int verbosity)
-{
- graphite_dim_t i;
- gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
-
- if (!pbb->domain)
- return;
-
- if (verbosity > 0)
- {
- fprintf (file, "\n# Iteration domain of bb_%d (\n", GBB_BB (gbb)->index);
- fprintf (file, "#eq");
-
- for (i = 0; i < pbb_dim_iter_domain (pbb); i++)
- fprintf (file, " i%d", (int) i);
-
- for (i = 0; i < pbb_nb_params (pbb); i++)
- fprintf (file, " p%d", (int) i);
-
- fprintf (file, " cst\n");
- }
-
- fprintf (file, "XXX isl\n");
-
- if (verbosity > 0)
- fprintf (file, "#)\n");
-}
-
/* Print to FILE the domain of PBB, at some VERBOSITY level. */
void
@@ -699,8 +500,7 @@ print_pbb (FILE *file, poly_bb_p pbb, int verbosity)
dump_gbb_cases (file, PBB_BLACK_BOX (pbb));
}
- openscop_print_pbb_domain (file, pbb, verbosity);
- print_scattering_function (file, pbb, verbosity);
+ print_pbb_domain (file, pbb, verbosity);
print_pdrs (file, pbb, verbosity);
print_pbb_body (file, pbb, verbosity, false);
@@ -748,58 +548,16 @@ print_scop_params (FILE *file, scop_p scop, int verbosity)
fprintf (file, "#)\n");
}
-/* Print to FILE the context of SCoP in OpenScop format, at some VERBOSITY
- level. */
-
-static void
-openscop_print_scop_context (FILE *file, scop_p scop, int verbosity)
-{
- graphite_dim_t i;
-
- if (verbosity > 0)
- {
- fprintf (file, "# Context (\n");
- fprintf (file, "#eq");
-
- for (i = 0; i < scop_nb_params (scop); i++)
- fprintf (file, " p%d", (int) i);
-
- fprintf (file, " cst\n");
- }
-
- if (scop->context)
- /* XXX isl print context */
- fprintf (file, "XXX isl\n");
- else
- fprintf (file, "0 %d 0 0 0 %d\n", (int) scop_nb_params (scop) + 2,
- (int) scop_nb_params (scop));
-
- if (verbosity > 0)
- fprintf (file, "# )\n");
-}
-
/* Print to FILE the context of SCoP, at some VERBOSITY level. */
void
print_scop_context (FILE *file, scop_p scop, int verbosity)
{
- graphite_dim_t i;
-
if (verbosity > 0)
- {
- fprintf (file, "# Context (\n");
- fprintf (file, "#eq");
-
- for (i = 0; i < scop_nb_params (scop); i++)
- fprintf (file, " p%d", (int) i);
-
- fprintf (file, " cst\n");
- }
+ fprintf (file, "# Context (\n");
if (scop->context)
print_isl_set (file, scop->context);
- else
- fprintf (file, "no isl context %d\n", (int) scop_nb_params (scop) + 2);
if (verbosity > 0)
fprintf (file, "# )\n");
@@ -815,7 +573,7 @@ print_scop (FILE *file, scop_p scop, int verbosity)
fprintf (file, "SCoP 1\n#(\n");
fprintf (file, "# Language\nGimple\n");
- openscop_print_scop_context (file, scop, verbosity);
+ print_scop_context (file, scop, verbosity);
print_scop_params (file, scop, verbosity);
if (verbosity > 0)
@@ -826,17 +584,6 @@ print_scop (FILE *file, scop_p scop, int verbosity)
FOR_EACH_VEC_ELT (SCOP_BBS (scop), i, pbb)
print_pbb (file, pbb, verbosity);
- if (verbosity > 1)
- {
- fprintf (file, "# original_lst (\n");
- print_lst (file, SCOP_ORIGINAL_SCHEDULE (scop), 0);
- fprintf (file, "\n#)\n");
-
- fprintf (file, "# transformed_lst (\n");
- print_lst (file, SCOP_TRANSFORMED_SCHEDULE (scop), 0);
- fprintf (file, "\n#)\n");
- }
-
fprintf (file, "#)\n");
}
@@ -888,6 +635,7 @@ print_isl_set (FILE *f, isl_set *set)
{
isl_printer *p = isl_printer_to_file (the_isl_ctx, f);
p = isl_printer_print_set (p, set);
+ p = isl_printer_print_str (p, "\n");
isl_printer_free (p);
}
@@ -902,6 +650,7 @@ print_isl_map (FILE *f, isl_map *map)
{
isl_printer *p = isl_printer_to_file (the_isl_ctx, f);
p = isl_printer_print_map (p, map);
+ p = isl_printer_print_str (p, "\n");
isl_printer_free (p);
}
@@ -916,6 +665,7 @@ print_isl_aff (FILE *f, isl_aff *aff)
{
isl_printer *p = isl_printer_to_file (the_isl_ctx, f);
p = isl_printer_print_aff (p, aff);
+ p = isl_printer_print_str (p, "\n");
isl_printer_free (p);
}
@@ -930,6 +680,7 @@ print_isl_constraint (FILE *f, isl_constraint *c)
{
isl_printer *p = isl_printer_to_file (the_isl_ctx, f);
p = isl_printer_print_constraint (p, c);
+ p = isl_printer_print_str (p, "\n");
isl_printer_free (p);
}
@@ -976,224 +727,5 @@ pbb_number_of_iterations_at_time (poly_bb_p pbb,
isl_set_free (transdomain);
}
-/* Translates LOOP to LST. */
-
-static lst_p
-loop_to_lst (loop_p loop, vec<poly_bb_p> bbs, int *i)
-{
- poly_bb_p pbb;
- vec<lst_p> seq;
- seq.create (5);
-
- for (; bbs.iterate (*i, &pbb); (*i)++)
- {
- lst_p stmt;
- basic_block bb = GBB_BB (PBB_BLACK_BOX (pbb));
-
- if (bb->loop_father == loop)
- stmt = new_lst_stmt (pbb);
- else if (flow_bb_inside_loop_p (loop, bb))
- {
- loop_p next = loop->inner;
-
- while (next && !flow_bb_inside_loop_p (next, bb))
- next = next->next;
-
- stmt = loop_to_lst (next, bbs, i);
- }
- else
- {
- (*i)--;
- return new_lst_loop (seq);
- }
-
- seq.safe_push (stmt);
- }
-
- return new_lst_loop (seq);
-}
-
-/* Reads the original scattering of the SCOP and returns an LST
- representing it. */
-
-void
-scop_to_lst (scop_p scop)
-{
- lst_p res;
- int i, n = SCOP_BBS (scop).length ();
- vec<lst_p> seq;
- seq.create (5);
- sese region = SCOP_REGION (scop);
-
- for (i = 0; i < n; i++)
- {
- poly_bb_p pbb = SCOP_BBS (scop)[i];
- loop_p loop = outermost_loop_in_sese (region, GBB_BB (PBB_BLACK_BOX (pbb)));
-
- if (loop_in_sese_p (loop, region))
- res = loop_to_lst (loop, SCOP_BBS (scop), &i);
- else
- res = new_lst_stmt (pbb);
-
- seq.safe_push (res);
- }
-
- res = new_lst_loop (seq);
- SCOP_ORIGINAL_SCHEDULE (scop) = res;
- SCOP_TRANSFORMED_SCHEDULE (scop) = copy_lst (res);
-}
-
-/* Print to FILE on a new line COLUMN white spaces. */
-
-static void
-lst_indent_to (FILE *file, int column)
-{
- int i;
-
- if (column > 0)
- fprintf (file, "\n#");
-
- for (i = 0; i < column; i++)
- fprintf (file, " ");
-}
-
-/* Print LST to FILE with INDENT spaces of indentation. */
-
-void
-print_lst (FILE *file, lst_p lst, int indent)
-{
- if (!lst)
- return;
-
- lst_indent_to (file, indent);
-
- if (LST_LOOP_P (lst))
- {
- int i;
- lst_p l;
-
- if (LST_LOOP_FATHER (lst))
- fprintf (file, "%d (loop", lst_dewey_number (lst));
- else
- fprintf (file, "#(root");
-
- FOR_EACH_VEC_ELT (LST_SEQ (lst), i, l)
- print_lst (file, l, indent + 2);
-
- fprintf (file, ")");
- }
- else
- fprintf (file, "%d stmt_%d", lst_dewey_number (lst), pbb_index (LST_PBB (lst)));
-}
-
-/* Print LST to STDERR. */
-
-DEBUG_FUNCTION void
-debug_lst (lst_p lst)
-{
- print_lst (stderr, lst, 0);
-}
-
-/* Pretty print to FILE the loop statement tree LST in DOT format. */
-
-static void
-dot_lst_1 (FILE *file, lst_p lst)
-{
- if (!lst)
- return;
-
- if (LST_LOOP_P (lst))
- {
- int i;
- lst_p l;
-
- if (!LST_LOOP_FATHER (lst))
- fprintf (file, "L -> L_%d_%d\n",
- lst_depth (lst),
- lst_dewey_number (lst));
- else
- fprintf (file, "L_%d_%d -> L_%d_%d\n",
- lst_depth (LST_LOOP_FATHER (lst)),
- lst_dewey_number (LST_LOOP_FATHER (lst)),
- lst_depth (lst),
- lst_dewey_number (lst));
-
- FOR_EACH_VEC_ELT (LST_SEQ (lst), i, l)
- dot_lst_1 (file, l);
- }
-
- else
- fprintf (file, "L_%d_%d -> S_%d\n",
- lst_depth (LST_LOOP_FATHER (lst)),
- lst_dewey_number (LST_LOOP_FATHER (lst)),
- pbb_index (LST_PBB (lst)));
-
-}
-
-/* Display the LST using dotty. */
-
-DEBUG_FUNCTION void
-dot_lst (lst_p lst)
-{
- /* When debugging, enable the following code. This cannot be used
- in production compilers because it calls "system". */
-#if 0
- FILE *stream = fopen ("/tmp/lst.dot", "w");
- gcc_assert (stream);
-
- fputs ("digraph all {\n", stream);
- dot_lst_1 (stream, lst);
- fputs ("}\n\n", stream);
- fclose (stream);
-
- system ("dotty /tmp/lst.dot &");
-#else
- fputs ("digraph all {\n", stderr);
- dot_lst_1 (stderr, lst);
- fputs ("}\n\n", stderr);
-
-#endif
-}
-
-/* Reverse the loop around PBB at level DEPTH. */
-
-isl_map *
-reverse_loop_at_level (poly_bb_p pbb, int depth)
-{
- unsigned i, depth_dim = psct_dynamic_dim (pbb, depth);
- isl_space *d = isl_map_get_space (pbb->transformed);
- isl_space *d1 = isl_space_range (d);
- unsigned n = isl_space_dim (d1, isl_dim_out);
- isl_space *d2 = isl_space_add_dims (d1, isl_dim_in, n);
- isl_map *x = isl_map_universe (isl_space_copy (d2));
- isl_constraint *c = isl_equality_alloc (isl_local_space_from_space (d2));
-
- for (i = 0; i < n; i++)
- if (i != depth_dim)
- x = isl_map_equate (x, isl_dim_in, i, isl_dim_out, i);
-
- c = isl_constraint_set_coefficient_si (c, isl_dim_in, depth_dim, 1);
- c = isl_constraint_set_coefficient_si (c, isl_dim_out, depth_dim, 1);
- x = isl_map_add_constraint (x, c);
- return x;
-}
-
-/* Reverse the loop at level DEPTH for all the PBBS. */
-
-isl_union_map *
-reverse_loop_for_pbbs (scop_p scop, vec<poly_bb_p> pbbs, int depth)
-{
- poly_bb_p pbb;
- int i;
- isl_space *space = isl_space_from_domain (isl_set_get_space (scop->context));
- isl_union_map *res = isl_union_map_empty (space);
-
- for (i = 0; pbbs.iterate (i, &pbb); i++)
- res = isl_union_map_add_map (res, reverse_loop_at_level (pbb, depth));
-
- return res;
-}
-
-
#endif /* HAVE_isl */