aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2009-11-25 05:31:07 +0000
committerSebastian Pop <spop@gcc.gnu.org>2009-11-25 05:31:07 +0000
commit25e20d33e670ee1602e51cdf4be0c25a8d97954d (patch)
tree9c97dfb8266cc4f33365988c9766a8e4bc01629c /gcc
parente3bde9f4bc8a008a07e1caba789562d0abd627d6 (diff)
downloadgcc-25e20d33e670ee1602e51cdf4be0c25a8d97954d.zip
gcc-25e20d33e670ee1602e51cdf4be0c25a8d97954d.tar.gz
gcc-25e20d33e670ee1602e51cdf4be0c25a8d97954d.tar.bz2
graphite-blocking.c (scop_do_block): New.
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. From-SVN: r154638
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog.graphite6
-rw-r--r--gcc/graphite-blocking.c28
-rw-r--r--gcc/graphite-poly.c5
-rw-r--r--gcc/graphite-poly.h1
4 files changed, 35 insertions, 5 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b5e20d7..8ae2d55 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,11 @@
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.
+
+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
diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c
index 4c8a700..3cf60e9 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
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index fa949cc..6ed6a84 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -250,10 +250,7 @@ apply_poly_transforms (scop_p scop)
transform_done = true;
if (flag_loop_block)
- {
- transform_done |= scop_do_strip_mine (scop);
- transform_done |= scop_do_interchange (scop);
- }
+ transform_done |= scop_do_block (scop);
else
{
if (flag_loop_strip_mine)
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index 8f25a37..4912801 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -358,6 +358,7 @@ extern void debug_iteration_domain (poly_bb_p);
extern void debug_iteration_domains (scop_p);
extern bool scop_do_interchange (scop_p);
extern bool scop_do_strip_mine (scop_p);
+extern bool scop_do_block (scop_p);
extern void pbb_number_of_iterations (poly_bb_p, graphite_dim_t, Value);
extern void pbb_number_of_iterations_at_time (poly_bb_p, graphite_dim_t, Value);
extern void pbb_remove_duplicate_pdrs (poly_bb_p);