aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2009-11-25 05:09:36 +0000
committerSebastian Pop <spop@gcc.gnu.org>2009-11-25 05:09:36 +0000
commit5c6c42c98d9a324859fb338a20abda1be82b9bda (patch)
tree3eeff7406c772b94df31eb9b98f5ad05912452c3 /gcc
parentf58be90efba79bec87e9bc526fa57106c532d9e0 (diff)
downloadgcc-5c6c42c98d9a324859fb338a20abda1be82b9bda.zip
gcc-5c6c42c98d9a324859fb338a20abda1be82b9bda.tar.gz
gcc-5c6c42c98d9a324859fb338a20abda1be82b9bda.tar.bz2
graphite-blocking.c (lst_do_strip_mine): Avoid strip mining the root of the LST.
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. From-SVN: r154593
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog.graphite11
-rw-r--r--gcc/graphite-blocking.c5
-rw-r--r--gcc/graphite-interchange.c5
-rw-r--r--gcc/graphite-poly.c30
-rw-r--r--gcc/graphite-poly.h6
5 files changed, 47 insertions, 10 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index defc111..535cd0c 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,16 @@
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.
+
+2009-10-15 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-poly.c (print_scop): Fix pretty printing of a SCoP.
2009-10-15 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c
index b5f5acd..e44ad8a 100644
--- a/gcc/graphite-blocking.c
+++ b/gcc/graphite-blocking.c
@@ -242,8 +242,9 @@ lst_do_strip_mine (lst_p lst)
for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
res |= lst_do_strip_mine (l);
- if (pbb_strip_mine_profitable_p (LST_PBB (lst_find_first_pbb (lst)),
- lst_depth (lst), stride))
+ if (lst_depth (lst) >= 0
+ && pbb_strip_mine_profitable_p (LST_PBB (lst_find_first_pbb (lst)),
+ lst_depth (lst), stride))
{
res |= lst_do_strip_mine_loop (lst, lst_depth (lst));
lst_add_loop_under_loop (lst);
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c
index cb703f2..b42a133 100644
--- a/gcc/graphite-interchange.c
+++ b/gcc/graphite-interchange.c
@@ -539,8 +539,9 @@ lst_do_interchange (scop_p scop, lst_p lst)
lst_p l;
bool res = false;
- for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
- res |= lst_try_interchange (scop, lst, l);
+ if (lst_depth (lst) >= 0)
+ for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ res |= lst_try_interchange (scop, lst, l);
for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
res |= lst_do_interchange (scop, l);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 8d75fd4..17d8881 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);
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index 64a082e..8165d35 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -714,6 +714,12 @@ static inline int
lst_depth (lst_p lst)
{
if (!lst)
+ return -2;
+
+ /* The depth of the outermost "fake" loop is -1. This outermost
+ loop does not have a loop father and it is just a container, as
+ in the loop representation of GCC. */
+ if (!LST_LOOP_FATHER (lst))
return -1;
return lst_depth (LST_LOOP_FATHER (lst)) + 1;