diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 05:31:07 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-25 05:31:07 +0000 |
commit | 64d8f27a1751f377b94dfa4ac0762dd15b6ea181 (patch) | |
tree | 9c97dfb8266cc4f33365988c9766a8e4bc01629c /gcc/graphite-blocking.c | |
parent | 9a0158f5405d63f114f45afd293cd69182a0bdb4 (diff) | |
download | gcc-64d8f27a1751f377b94dfa4ac0762dd15b6ea181.tar.gz |
2009-11-18 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (scop_do_block): New.
* graphite-poly.c (apply_poly_transforms): Call scop_do_block.
* graphite-poly.h (scop_do_block): Declared.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154638 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-blocking.c')
-rw-r--r-- | gcc/graphite-blocking.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c index 4c8a700f9ec..3cf60e92001 100644 --- a/gcc/graphite-blocking.c +++ b/gcc/graphite-blocking.c @@ -255,7 +255,6 @@ lst_do_strip_mine (lst_p lst) return res; } - /* Strip mines all the loops in SCOP. Nothing profitable in all this: this is just a driver function. */ @@ -280,4 +279,31 @@ scop_do_strip_mine (scop_p scop) return transform_done; } +/* Loop blocks all the loops in SCOP. Returns true when we manage to + block some loops. */ + +bool +scop_do_block (scop_p scop) +{ + bool transform_done = false; + + store_scattering (scop); + + lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); + transform_done = scop_do_interchange (scop); + + /* If we don't interchange loops, then the strip mine is not + profitable, and the transform is not a loop blocking. */ + if (!transform_done + || !graphite_legal_transform (scop)) + { + restore_scattering (scop); + return false; + } + else if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "SCoP will be loop blocked.\n"); + + return transform_done; +} + #endif |