diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2011-07-05 14:50:34 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2011-07-05 14:50:34 +0000 |
commit | cec11ec4142e5d300aa36cbee1b54adefdee7711 (patch) | |
tree | bb332b8bbbc0bb93e01d2b53950af05852a521d7 /gcc/graphite-interchange.c | |
parent | 9b0d314a45803f7663e37f669488c695bcf253fa (diff) | |
download | gcc-cec11ec4142e5d300aa36cbee1b54adefdee7711.zip gcc-cec11ec4142e5d300aa36cbee1b54adefdee7711.tar.gz gcc-cec11ec4142e5d300aa36cbee1b54adefdee7711.tar.bz2 |
Fix PR47654: Loop blocking should strip-mine at least two loops.
PR tree-optimization/47654
* graphite-blocking.c (pbb_strip_mine_time_depth): Do not return bool.
(lst_do_strip_mine_loop): Return an int.
(lst_do_strip_mine): Same.
(scop_do_strip_mine): Same.
(scop_do_block): Loop blocking should strip-mine at least two loops.
* graphite-interchange.c (lst_interchange_select_outer): Return an int.
(scop_do_interchange): Same.
* graphite-poly.h (scop_do_interchange): Update declaration.
(scop_do_strip_mine): Same.
* gcc.dg/graphite/block-pr47654.c: New.
From-SVN: r175861
Diffstat (limited to 'gcc/graphite-interchange.c')
-rw-r--r-- | gcc/graphite-interchange.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c index 934839a..cb4d32cc 100644 --- a/gcc/graphite-interchange.c +++ b/gcc/graphite-interchange.c @@ -664,27 +664,27 @@ lst_interchange_select_inner (scop_p scop, lst_p outer_father, int outer, } /* Interchanges all the loops of LOOP and the loops of its body that - are considered profitable to interchange. Return true if it did - interchanged some loops. OUTER is the index in LST_SEQ (LOOP) that + are considered profitable to interchange. Return the number of + interchanged loops. OUTER is the index in LST_SEQ (LOOP) that points to the next outer loop to be considered for interchange. */ -static bool +static int lst_interchange_select_outer (scop_p scop, lst_p loop, int outer) { lst_p l; - bool res = false; + int res = 0; int i = 0; lst_p father; if (!loop || !LST_LOOP_P (loop)) - return false; + return 0; father = LST_LOOP_FATHER (loop); if (father) { while (lst_interchange_select_inner (scop, father, outer, loop)) { - res = true; + res++; loop = VEC_index (lst_p, LST_SEQ (father), outer); } } @@ -692,17 +692,18 @@ lst_interchange_select_outer (scop_p scop, lst_p loop, int outer) if (LST_LOOP_P (loop)) FOR_EACH_VEC_ELT (lst_p, LST_SEQ (loop), i, l) if (LST_LOOP_P (l)) - res |= lst_interchange_select_outer (scop, l, i); + res += lst_interchange_select_outer (scop, l, i); return res; } -/* Interchanges all the loop depths that are considered profitable for SCOP. */ +/* Interchanges all the loop depths that are considered profitable for + SCOP. Return the number of interchanged loops. */ -bool +int scop_do_interchange (scop_p scop) { - bool res = lst_interchange_select_outer + int res = lst_interchange_select_outer (scop, SCOP_TRANSFORMED_SCHEDULE (scop), 0); lst_update_scattering (SCOP_TRANSFORMED_SCHEDULE (scop)); |