diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2009-11-25 04:57:45 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2009-11-25 04:57:45 +0000 |
commit | a0517b76ddeb6fdbc4346a508e98ac842b539694 (patch) | |
tree | b88b198244b1d334d7ccde496eff481bce835ec2 | |
parent | 9d0778350be2a1fbb2cded2f4e7a8586c80d4780 (diff) | |
download | gcc-a0517b76ddeb6fdbc4346a508e98ac842b539694.zip gcc-a0517b76ddeb6fdbc4346a508e98ac842b539694.tar.gz gcc-a0517b76ddeb6fdbc4346a508e98ac842b539694.tar.bz2 |
graphite-poly.h (lst_find_pbb): New.
2009-10-09 Sebastian Pop <sebastian.pop@amd.com>
* graphite-poly.h (lst_find_pbb): New.
(find_lst_loop): New.
From-SVN: r154568
-rw-r--r-- | gcc/ChangeLog.graphite | 5 | ||||
-rw-r--r-- | gcc/graphite-poly.h | 41 | ||||
-rw-r--r-- | gcc/graphite-sese-to-poly.c | 1 |
3 files changed, 46 insertions, 1 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 4e816c6..a058e52 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,10 @@ 2009-10-09 Sebastian Pop <sebastian.pop@amd.com> + * graphite-poly.h (lst_find_pbb): New. + (find_lst_loop): New. + +2009-10-09 Sebastian Pop <sebastian.pop@amd.com> + * graphite-poly.c (new_scop): Remove init of SCOP_DEP_GRAPH. * graphite-poly.h (struct scop): Remove dep_graph field. (SCOP_DEP_GRAPH): Removed. diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h index ab6dbbb..f059834 100644 --- a/gcc/graphite-poly.h +++ b/gcc/graphite-poly.h @@ -724,6 +724,47 @@ lst_dewey_number (lst_p lst) return -1; } +/* Return the LST node corresponding to PBB. */ + +static inline lst_p +lst_find_pbb (lst_p lst, poly_bb_p pbb) +{ + 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_pbb (l, pbb); + if (res) + return res; + } + else if (pbb == LST_PBB (lst)) + return lst; + + return NULL; +} + +/* Return the LST node corresponding to the loop around STMT at depth + LOOP_DEPTH. */ + +static inline lst_p +find_lst_loop (lst_p stmt, int loop_depth) +{ + lst_p loop = LST_LOOP_FATHER (stmt); + + gcc_assert (loop_depth >= 0); + + while (loop_depth < lst_depth (loop)) + loop = LST_LOOP_FATHER (loop); + + return loop; +} + + /* A SCOP is a Static Control Part of the program, simple enough to be represented in polyhedral form. */ struct scop diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 1dea7fd..24e79cf 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -1060,7 +1060,6 @@ gbb_from_bb (basic_block bb) static void build_loop_iteration_domains (scop_p scop, struct loop *loop, ppl_Polyhedron_t outer_ph, int nb) - { int i; ppl_Polyhedron_t ph; |