diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 05:09:36 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 05:09:36 +0000 |
commit | 43217ce91110f35e448c42647e969093efc4e8e9 (patch) | |
tree | 3eeff7406c772b94df31eb9b98f5ad05912452c3 /gcc/graphite-poly.c | |
parent | 9b6c835ccc29616a75588366755df30ba0c26a21 (diff) | |
download | gcc-43217ce91110f35e448c42647e969093efc4e8e9.tar.gz |
2009-10-15 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (lst_do_strip_mine): Avoid strip mining the
root of the LST.
* graphite-interchange.c (lst_do_interchange): Avoid interchanging
the root of the LST.
* graphite-poly.c (scop_to_lst): Fix LST sequence in an outermost
fake loop.
(print_lst): Print the root of LST in a different format.
* graphite-poly.h (lst_depth): Adjust to include the root of the LST.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154593 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-poly.c')
-rw-r--r-- | gcc/graphite-poly.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c index 8d75fd47f3f..17d88815b4d 100644 --- a/gcc/graphite-poly.c +++ b/gcc/graphite-poly.c @@ -869,12 +869,27 @@ loop_to_lst (loop_p loop, VEC (poly_bb_p, heap) *bbs, int *i) void scop_to_lst (scop_p scop) { - poly_bb_p pbb = VEC_index (poly_bb_p, SCOP_BBS (scop), 0); - loop_p loop = outermost_loop_in_sese (SCOP_REGION (scop), GBB_BB (PBB_BLACK_BOX (pbb))); - int i = 0; + lst_p res; + int i, n = VEC_length (poly_bb_p, SCOP_BBS (scop)); + VEC (lst_p, heap) *seq = VEC_alloc (lst_p, heap, 5); + sese region = SCOP_REGION (scop); + + for (i = 0; i < n; i++) + { + poly_bb_p pbb = VEC_index (poly_bb_p, 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); + + VEC_safe_push (lst_p, heap, seq, res); + } - SCOP_ORIGINAL_SCHEDULE (scop) = loop_to_lst (loop, SCOP_BBS (scop), &i); - SCOP_TRANSFORMED_SCHEDULE (scop) = copy_lst (SCOP_ORIGINAL_SCHEDULE (scop)); + res = new_lst_loop (seq); + SCOP_ORIGINAL_SCHEDULE (scop) = res; + SCOP_TRANSFORMED_SCHEDULE (scop) = copy_lst (res); } /* Print LST to FILE with INDENT spaces of indentation. */ @@ -892,7 +907,10 @@ print_lst (FILE *file, lst_p lst, int indent) int i; lst_p l; - fprintf (file, "%d (loop", lst_dewey_number (lst)); + if (LST_LOOP_FATHER (lst)) + fprintf (file, "%d (loop", lst_dewey_number (lst)); + else + fprintf (file, "(root"); for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++) print_lst (file, l, indent + 2); |