diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2011-01-25 06:45:16 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2011-01-25 06:45:16 +0000 |
commit | 271fb6fae1c01083fe3abb084134b9549623f204 (patch) | |
tree | a6ac26ee532a93754ef5a0d99b255b063cca8a4e /gcc | |
parent | 92d236802c2627840591e08c522c3abe6e63ff70 (diff) | |
download | gcc-271fb6fae1c01083fe3abb084134b9549623f204.zip gcc-271fb6fae1c01083fe3abb084134b9549623f204.tar.gz gcc-271fb6fae1c01083fe3abb084134b9549623f204.tar.bz2 |
Fix pbb_remove_duplicate_pdrs.
2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
* graphite-poly.c (pbb_remove_duplicate_pdrs): Make it work.
From-SVN: r169202
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ChangeLog.graphite | 4 | ||||
-rw-r--r-- | gcc/graphite-poly.c | 13 |
3 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8d13d2c..e9e145a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2011-01-25 Sebastian Pop <sebastian.pop@amd.com> + * graphite-poly.c (pbb_remove_duplicate_pdrs): Make it work. + +2011-01-25 Sebastian Pop <sebastian.pop@amd.com> + * graphite-interchange.c (lst_interchange_profitable_p): Takes a loop nest and two loop depths as parameters. (lst_try_interchange_loops): Call lst_interchange_profitable_p after diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 2363df6..d961c0c 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,9 @@ 2011-01-15 Sebastian Pop <sebastian.pop@amd.com> + * graphite-poly.c (pbb_remove_duplicate_pdrs): Make it work. + +2011-01-15 Sebastian Pop <sebastian.pop@amd.com> + * graphite-interchange.c (lst_interchange_profitable_p): Takes a loop nest and two loop depths as parameters. (lst_try_interchange_loops): Call lst_interchange_profitable_p after diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c index f88788b..bfdbc9f 100644 --- a/gcc/graphite-poly.c +++ b/gcc/graphite-poly.c @@ -813,15 +813,16 @@ pbb_remove_duplicate_pdrs (poly_bb_p pbb) { int i, j; poly_dr_p pdr1, pdr2; - unsigned n = VEC_length (poly_dr_p, PBB_DRS (pbb)); - VEC (poly_dr_p, heap) *collapsed = VEC_alloc (poly_dr_p, heap, n); FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr1) - FOR_EACH_VEC_ELT (poly_dr_p, collapsed, j, pdr2) - if (!can_collapse_pdrs (pdr1, pdr2)) - VEC_quick_push (poly_dr_p, collapsed, pdr1); + for (j = i + 1; VEC_iterate (poly_dr_p, PBB_DRS (pbb), j, pdr2); j++) + if (can_collapse_pdrs (pdr1, pdr2)) + { + PDR_NB_REFS (pdr1) += PDR_NB_REFS (pdr2); + free_poly_dr (pdr2); + VEC_ordered_remove (poly_dr_p, PBB_DRS (pbb), j); + } - VEC_free (poly_dr_p, heap, collapsed); PBB_PDR_DUPLICATES_REMOVED (pbb) = true; } |