diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 04:55:53 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 04:55:53 +0000 |
commit | f007fe9730d912ef3185d08f3835d5e4680f2331 (patch) | |
tree | 691791191c1405beb47bca42a0c50bebbd5d5502 /gcc/graphite-poly.h | |
parent | 4d0382bc1a3eb50c7d7964e0a3f639728d61e94d (diff) | |
download | gcc-f007fe9730d912ef3185d08f3835d5e4680f2331.tar.gz |
2009-10-06 Sebastian Pop <sebastian.pop@amd.com>
* graphite-dependences.c (reduction_dr_1): New.
(reduction_dr_p): New.
(graphite_legal_transform_dr): Call reduction_dr_p.
(reduction_ddr): Renamed reduction_ddr_p.
* graphite-poly.h (same_pdr_p): New.
(number_of_write_pdrs): New.
* graphite-sese-to-poly.c (nb_data_writes_in_bb): New.
(split_reduction_stmt): Do not split reduction statements
when there are no writes to memory.
(translate_scalar_reduction_to_array_for_stmt): Insert the
memory reduction statement just after the scalar reduction statement.
* gcc.dg/graphite/interchange-10.c: Updated to differ from interchange-4.c.
Un-XFAIL-ed.
* gcc.dg/graphite/interchange-3.c: Un-XFAIL-ed.
* gcc.dg/graphite/interchange-4.c: Un-XFAIL-ed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154564 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-poly.h')
-rw-r--r-- | gcc/graphite-poly.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h index f9e59db89e5..b3541d6610a 100644 --- a/gcc/graphite-poly.h +++ b/gcc/graphite-poly.h @@ -248,6 +248,17 @@ pdr_may_write_p (poly_dr_p pdr) return PDR_TYPE (pdr) == PDR_MAY_WRITE; } +/* Return true when PDR1 and PDR2 are similar data accesses: they have + the same base array, and the same access functions. */ + +static inline bool +same_pdr_p (poly_dr_p pdr1, poly_dr_p pdr2) +{ + return PDR_TYPE (pdr1) == PDR_TYPE (pdr2) + && PDR_NB_SUBSCRIPTS (pdr1) == PDR_NB_SUBSCRIPTS (pdr2) + && PDR_BASE_OBJECT_SET (pdr1) == PDR_BASE_OBJECT_SET (pdr2); +} + typedef struct poly_scattering *poly_scattering_p; struct poly_scattering @@ -351,6 +362,22 @@ extern void pbb_number_of_iterations (poly_bb_p, graphite_dim_t, Value); extern void pbb_number_of_iterations_at_time (poly_bb_p, graphite_dim_t, Value); extern void pbb_remove_duplicate_pdrs (poly_bb_p); +/* Return the number of write data references in PBB. */ + +static inline int +number_of_write_pdrs (poly_bb_p pbb) +{ + int res = 0; + int i; + poly_dr_p pdr; + + for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++) + if (PDR_TYPE (pdr) == PDR_WRITE) + res++; + + return res; +} + /* The index of the PBB. */ static inline int |