Commit e3bde9f4 by Sebastian Pop Committed by Sebastian Pop

graphite-blocking.c (pbb_strip_mine_profitable_p): The parameter depth is the…

graphite-blocking.c (pbb_strip_mine_profitable_p): The parameter depth is the loop nesting depth in the LST.

2009-11-18  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-blocking.c (pbb_strip_mine_profitable_p): The parameter
	depth is the loop nesting depth in the LST.  Call psct_dynamic_dim
	to transform depth into the time_depth before calling
	pbb_number_of_iterations_at_time.
	(lst_do_strip_mine): Use a scalar variable instead of recomputing
	lst_depth.

From-SVN: r154637
parent 27e432be
2009-11-18 Sebastian Pop <sebastian.pop@amd.com> 2009-11-18 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (pbb_strip_mine_profitable_p): The parameter
depth is the loop nesting depth in the LST. Call psct_dynamic_dim
to transform depth into the time_depth before calling
pbb_number_of_iterations_at_time.
(lst_do_strip_mine): Use a scalar variable instead of recomputing
lst_depth.
2009-11-18 Sebastian Pop <sebastian.pop@amd.com>
Reverted the patch for "scattering permutations" from 2009-10-28. Reverted the patch for "scattering permutations" from 2009-10-28.
* graphite-poly.c (print_permutation): New. * graphite-poly.c (print_permutation): New.
......
...@@ -174,11 +174,11 @@ pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride) ...@@ -174,11 +174,11 @@ pbb_strip_mine_time_depth (poly_bb_p pbb, int time_depth, int stride)
} }
/* Returns true when strip mining with STRIDE of the loop around PBB /* Returns true when strip mining with STRIDE of the loop around PBB
at scattering time TIME_DEPTH is profitable. */ at DEPTH is profitable. */
static bool static bool
pbb_strip_mine_profitable_p (poly_bb_p pbb, pbb_strip_mine_profitable_p (poly_bb_p pbb,
graphite_dim_t time_depth, graphite_dim_t depth,
int stride) int stride)
{ {
Value niter, strip_stride; Value niter, strip_stride;
...@@ -187,7 +187,7 @@ pbb_strip_mine_profitable_p (poly_bb_p pbb, ...@@ -187,7 +187,7 @@ pbb_strip_mine_profitable_p (poly_bb_p pbb,
value_init (strip_stride); value_init (strip_stride);
value_init (niter); value_init (niter);
value_set_si (strip_stride, stride); value_set_si (strip_stride, stride);
pbb_number_of_iterations_at_time (pbb, time_depth, niter); pbb_number_of_iterations_at_time (pbb, psct_dynamic_dim (pbb, depth), niter);
res = value_gt (niter, strip_stride); res = value_gt (niter, strip_stride);
value_clear (strip_stride); value_clear (strip_stride);
value_clear (niter); value_clear (niter);
...@@ -234,6 +234,7 @@ lst_do_strip_mine (lst_p lst) ...@@ -234,6 +234,7 @@ lst_do_strip_mine (lst_p lst)
lst_p l; lst_p l;
bool res = false; bool res = false;
int stride = PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE); int stride = PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE);
int depth;
if (!lst if (!lst
|| !LST_LOOP_P (lst)) || !LST_LOOP_P (lst))
...@@ -242,9 +243,10 @@ lst_do_strip_mine (lst_p lst) ...@@ -242,9 +243,10 @@ lst_do_strip_mine (lst_p lst)
for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++) for (i = 0; VEC_iterate (lst_p, LST_SEQ (lst), i, l); i++)
res |= lst_do_strip_mine (l); res |= lst_do_strip_mine (l);
if (lst_depth (lst) >= 0 depth = lst_depth (lst);
if (depth >= 0
&& pbb_strip_mine_profitable_p (LST_PBB (lst_find_first_pbb (lst)), && pbb_strip_mine_profitable_p (LST_PBB (lst_find_first_pbb (lst)),
lst_depth (lst), stride)) depth, stride))
{ {
res |= lst_do_strip_mine_loop (lst, lst_depth (lst)); res |= lst_do_strip_mine_loop (lst, lst_depth (lst));
lst_add_loop_under_loop (lst); lst_add_loop_under_loop (lst);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment