diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2009-08-28 20:40:59 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2009-08-28 20:40:59 +0000 |
commit | 7bd2a8a7ef778f7425121974cea4204a11c24388 (patch) | |
tree | f4bc77546493208666cd3b4afa7a90ecb6195f6a /gcc/graphite-interchange.c | |
parent | 93b2db87bba9552a502db78e9e9bcd67b5687c98 (diff) | |
download | gcc-7bd2a8a7ef778f7425121974cea4204a11c24388.tar.gz |
graphite-interchange.c (pbb_interchange_profitable_p): Adjust the strides by multiplying by PDR_NB_REFS.
2009-08-28 Sebastian Pop <sebastian.pop@amd.com>
* graphite-interchange.c (pbb_interchange_profitable_p): Adjust
the strides by multiplying by PDR_NB_REFS.
* graphite-poly.c (can_collapse_pdr): New.
(pdr_find_duplicate): New.
(new_poly_dr): Call pdr_find_duplicate. Collapse duplicate PDRs.
Initialize PDR_NB_REFS.
* graphite-poly.h (struct poly_dr): Add field nb_refs.
(PDR_NB_REFS): New.
(new_poly_dr): Number of subscripts is a graphite_dim_t.
From-SVN: r151191
Diffstat (limited to 'gcc/graphite-interchange.c')
-rw-r--r-- | gcc/graphite-interchange.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c index bf944c80f20..0a751d6336e 100644 --- a/gcc/graphite-interchange.c +++ b/gcc/graphite-interchange.c @@ -244,7 +244,7 @@ pbb_interchange_profitable_p (graphite_dim_t depth1, graphite_dim_t depth2, { int i; poly_dr_p pdr; - Value d1, d2, s; + Value d1, d2, s, n; bool res; gcc_assert (depth1 < depth2); @@ -254,13 +254,18 @@ pbb_interchange_profitable_p (graphite_dim_t depth1, graphite_dim_t depth2, value_init (d2); value_set_si (d2, 0); value_init (s); + value_init (n); for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++) { + value_set_si (n, PDR_NB_REFS (pdr)); + memory_stride_in_loop (s, depth1, pdr); + value_multiply (s, s, n); value_addto (d1, d1, s); memory_stride_in_loop (s, depth2, pdr); + value_multiply (s, s, n); value_addto (d2, d2, s); } @@ -269,6 +274,7 @@ pbb_interchange_profitable_p (graphite_dim_t depth1, graphite_dim_t depth2, value_clear (d1); value_clear (d2); value_clear (s); + value_clear (n); return res; } |