mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-21 23:00:52 +08:00
Outline lst_niter_for_loop.
2010-09-09 Sebastian Pop <sebastian.pop@amd.com> * graphite-blocking.c (pbb_strip_mine_profitable_p): Renamed lst_strip_mine_profitable_p. Call lst_niter_for_loop. * graphite-poly.h (lst_niter_for_loop): New. From-SVN: r164800
This commit is contained in:
parent
6eb412ef35
commit
22280f632d
@ -1,3 +1,9 @@
|
||||
2010-09-30 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-blocking.c (pbb_strip_mine_profitable_p): Renamed
|
||||
lst_strip_mine_profitable_p. Call lst_niter_for_loop.
|
||||
* graphite-poly.h (lst_niter_for_loop): New.
|
||||
|
||||
2010-09-30 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-poly.c (apply_poly_transforms): Do not abort when the
|
||||
|
@ -1,3 +1,9 @@
|
||||
2010-09-09 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-blocking.c (pbb_strip_mine_profitable_p): Renamed
|
||||
lst_strip_mine_profitable_p. Call lst_niter_for_loop.
|
||||
* graphite-poly.h (lst_niter_for_loop): New.
|
||||
|
||||
2010-09-09 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-poly.c (apply_poly_transforms): Do not abort when the
|
||||
|
@ -172,25 +172,25 @@ pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Returns true when strip mining with STRIDE of the loop around PBB
|
||||
at DEPTH is profitable. */
|
||||
/* Returns true when strip mining with STRIDE of the loop LST is
|
||||
profitable. */
|
||||
|
||||
static bool
|
||||
pbb_strip_mine_profitable_p (poly_bb_p pbb,
|
||||
graphite_dim_t depth,
|
||||
int stride)
|
||||
lst_strip_mine_profitable_p (lst_p lst, int stride)
|
||||
{
|
||||
mpz_t niter, strip_stride;
|
||||
bool res;
|
||||
|
||||
gcc_assert (LST_LOOP_P (lst));
|
||||
mpz_init (strip_stride);
|
||||
mpz_init (niter);
|
||||
|
||||
mpz_set_si (strip_stride, stride);
|
||||
pbb_number_of_iterations_at_time (pbb, psct_dynamic_dim (pbb, depth), niter);
|
||||
lst_niter_for_loop (lst, niter);
|
||||
res = (mpz_cmp (niter, strip_stride) > 0);
|
||||
|
||||
mpz_clear (strip_stride);
|
||||
mpz_clear (niter);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -244,8 +244,7 @@ lst_do_strip_mine (lst_p lst)
|
||||
|
||||
depth = lst_depth (lst);
|
||||
if (depth >= 0
|
||||
&& pbb_strip_mine_profitable_p (LST_PBB (lst_find_first_pbb (lst)),
|
||||
depth, stride))
|
||||
&& lst_strip_mine_profitable_p (lst, stride))
|
||||
{
|
||||
res |= lst_do_strip_mine_loop (lst, lst_depth (lst));
|
||||
lst_add_loop_under_loop (lst);
|
||||
|
@ -1062,6 +1062,19 @@ lst_remove_from_sequence (lst_p lst)
|
||||
LST_LOOP_FATHER (lst) = NULL;
|
||||
}
|
||||
|
||||
/* Sets NITER to the upper bound approximation of the number of
|
||||
iterations of loop LST. */
|
||||
|
||||
static inline void
|
||||
lst_niter_for_loop (lst_p lst, mpz_t niter)
|
||||
{
|
||||
int depth = lst_depth (lst);
|
||||
poly_bb_p pbb = LST_PBB (lst_find_first_pbb (lst));
|
||||
|
||||
gcc_assert (LST_LOOP_P (lst));
|
||||
pbb_number_of_iterations_at_time (pbb, psct_dynamic_dim (pbb, depth), niter);
|
||||
}
|
||||
|
||||
/* Updates the scattering of PBB to be at the DEWEY number in the loop
|
||||
at depth LEVEL. */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user