mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 16:10:41 +08:00
Test the profitability of interchange on the perfect nest.
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 lst_perfect_nestify. From-SVN: r169201
This commit is contained in:
parent
2f51defffd
commit
92d236802c
@ -1,3 +1,10 @@
|
||||
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
|
||||
lst_perfect_nestify.
|
||||
|
||||
2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-dependences.c (print_pddr): Call
|
||||
|
@ -1,3 +1,10 @@
|
||||
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
|
||||
lst_perfect_nestify.
|
||||
|
||||
2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-dependences.c (print_pddr): Call
|
||||
|
@ -446,20 +446,18 @@ memory_strides_in_loop (lst_p loop, graphite_dim_t depth, mpz_t strides)
|
||||
profitable to interchange the loops at DEPTH1 and DEPTH2. */
|
||||
|
||||
static bool
|
||||
lst_interchange_profitable_p (lst_p loop1, lst_p loop2)
|
||||
lst_interchange_profitable_p (lst_p nest, int depth1, int depth2)
|
||||
{
|
||||
mpz_t d1, d2;
|
||||
bool res;
|
||||
|
||||
gcc_assert (loop1 && loop2
|
||||
&& LST_LOOP_P (loop1) && LST_LOOP_P (loop2)
|
||||
&& lst_depth (loop1) < lst_depth (loop2));
|
||||
gcc_assert (depth1 < depth2);
|
||||
|
||||
mpz_init (d1);
|
||||
mpz_init (d2);
|
||||
|
||||
memory_strides_in_loop (loop1, lst_depth (loop1), d1);
|
||||
memory_strides_in_loop (loop2, lst_depth (loop2), d2);
|
||||
memory_strides_in_loop (nest, depth1, d1);
|
||||
memory_strides_in_loop (nest, depth2, d2);
|
||||
|
||||
res = mpz_cmp (d1, d2) < 0;
|
||||
|
||||
@ -592,12 +590,12 @@ lst_try_interchange_loops (scop_p scop, lst_p loop1, lst_p loop2)
|
||||
|
||||
lst_p before = NULL, nest = NULL, after = NULL;
|
||||
|
||||
if (!lst_interchange_profitable_p (loop1, loop2))
|
||||
return false;
|
||||
|
||||
if (!lst_perfectly_nested_p (loop1, loop2))
|
||||
lst_perfect_nestify (loop1, loop2, &before, &nest, &after);
|
||||
|
||||
if (!lst_interchange_profitable_p (loop2, depth1, depth2))
|
||||
return false;
|
||||
|
||||
lst_apply_interchange (loop2, depth1, depth2);
|
||||
|
||||
/* Sync the transformed LST information and the PBB scatterings
|
||||
|
Loading…
x
Reference in New Issue
Block a user