summaryrefslogtreecommitdiff
path: root/gcc/graphite-poly.h
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-25 05:04:26 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-25 05:04:26 +0000
commit0befefcc7155873ae56439545b4a17a6d270feb6 (patch)
treebcbb6916974039835a8e0203f66185d39b684c0b /gcc/graphite-poly.h
parent71b90bc33172c06d19cd7bfbdc6426e98e1aaf0a (diff)
downloadgcc-0befefcc7155873ae56439545b4a17a6d270feb6.tar.gz
2009-10-14 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (pbb_do_strip_mine): Removed. (lst_do_strip_mine_loop): New. (lst_do_strip_mine): New. (scop_do_strip_mine): Call lst_do_strip_mine. * graphite-poly.h (lst_add_loop_under_loop): New. (lst_find_first_pbb): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154582 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-poly.h')
-rw-r--r--gcc/graphite-poly.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index 3c82e68cd9c..64a082e4125 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -693,6 +693,21 @@ copy_lst (lst_p lst)
return new_lst_stmt (LST_PBB (lst));
}
+/* Adds a new loop under the loop LST. */
+
+static inline void
+lst_add_loop_under_loop (lst_p lst)
+{
+ VEC (lst_p, heap) *seq = VEC_alloc (lst_p, heap, 1);
+ lst_p l = new_lst_loop (LST_SEQ (lst));
+
+ gcc_assert (LST_LOOP_P (lst));
+
+ LST_LOOP_FATHER (l) = lst;
+ VEC_quick_push (lst_p, seq, l);
+ LST_SEQ (lst) = seq;
+}
+
/* Returns the loop depth of LST. */
static inline int
@@ -765,6 +780,27 @@ find_lst_loop (lst_p stmt, int loop_depth)
return loop;
}
+/* Return the LST node corresponding to PBB. */
+
+static inline lst_p
+lst_find_first_pbb (lst_p lst)
+{
+ int i;
+ lst_p l;
+
+ if (!lst)
+ return NULL;
+
+ if (LST_LOOP_P (lst))
+ for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
+ {
+ lst_p res = lst_find_first_pbb (l);
+ if (res)
+ return res;
+ }
+
+ return lst;
+}
/* A SCOP is a Static Control Part of the program, simple enough to be
represented in polyhedral form. */