From: Sebastian Pop <spop@codeaurora.org>
To: gcc-patches@gcc.gnu.org
Cc: hiraditya@msn.com, sebpop@gmail.com, richard.guenther@gmail.com
Subject: [PATCH 13/15] reinstantiate loop blocking
Date: Fri, 15 Jan 2016 17:15:00 -0000 [thread overview]
Message-ID: <1452878086-19297-13-git-send-email-sebpop@gmail.com> (raw)
In-Reply-To: <1452878086-19297-1-git-send-email-sebpop@gmail.com>
* graphite-optimize-isl.c (get_schedule_for_node_st): Add back.
(optimize_isl): Call isl_schedule_map_schedule_node_bottom_up.
* params.def (PARAM_LOOP_BLOCK_TILE_SIZE): Adjust to 32.
gcc/testsuite
* gcc.dg/graphite/block-1.c:
* gcc.dg/graphite/block-5.c:
* gcc.dg/graphite/block-6.c:
* gcc.dg/graphite/block-pr47654.c:
* gcc.dg/graphite/interchange-0.c:
* gcc.dg/graphite/interchange-12.c:
* gcc.dg/graphite/interchange-14.c:
* gcc.dg/graphite/interchange-15.c:
* gcc.dg/graphite/interchange-5.c:
* gcc.dg/graphite/interchange-6.c:
* gcc.dg/graphite/interchange-8.c:
* gcc.dg/graphite/interchange-mvt.c:
* gcc.dg/graphite/uns-block-1.c:
* gcc.dg/graphite/uns-interchange-12.c:
* gcc.dg/graphite/uns-interchange-14.c:
* gcc.dg/graphite/uns-interchange-15.c:
* gcc.dg/graphite/uns-interchange-mvt.c:
* gfortran.dg/graphite/pr14741.f90:
---
gcc/graphite-optimize-isl.c | 54 ++++++++++++++++++++++
gcc/params.def | 2 +-
gcc/testsuite/gcc.dg/graphite/block-1.c | 2 +-
gcc/testsuite/gcc.dg/graphite/block-5.c | 2 +-
gcc/testsuite/gcc.dg/graphite/block-6.c | 3 +-
gcc/testsuite/gcc.dg/graphite/block-pr47654.c | 2 +-
gcc/testsuite/gcc.dg/graphite/interchange-0.c | 2 +-
gcc/testsuite/gcc.dg/graphite/interchange-12.c | 3 +-
gcc/testsuite/gcc.dg/graphite/interchange-14.c | 3 +-
gcc/testsuite/gcc.dg/graphite/interchange-15.c | 2 +-
gcc/testsuite/gcc.dg/graphite/interchange-5.c | 2 +-
gcc/testsuite/gcc.dg/graphite/interchange-6.c | 2 +-
gcc/testsuite/gcc.dg/graphite/interchange-8.c | 3 +-
gcc/testsuite/gcc.dg/graphite/interchange-mvt.c | 2 +-
gcc/testsuite/gcc.dg/graphite/uns-block-1.c | 2 +-
gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c | 3 +-
gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c | 3 +-
gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c | 2 +-
.../gcc.dg/graphite/uns-interchange-mvt.c | 2 +-
gcc/testsuite/gfortran.dg/graphite/pr14741.f90 | 2 +-
20 files changed, 74 insertions(+), 24 deletions(-)
diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
index f385c77..28dc6d4 100644
--- a/gcc/graphite-optimize-isl.c
+++ b/gcc/graphite-optimize-isl.c
@@ -39,6 +39,56 @@ along with GCC; see the file COPYING3. If not see
#include "dumpfile.h"
#include "graphite.h"
+/* get_schedule_for_node_st - Improve schedule for the schedule node.
+ Only Simple loop tiling is considered. */
+
+static __isl_give isl_schedule_node *
+get_schedule_for_node_st (__isl_take isl_schedule_node *node, void *user)
+{
+ if (user)
+ return node;
+
+ if (isl_schedule_node_get_type (node) != isl_schedule_node_band
+ || isl_schedule_node_n_children (node) != 1)
+ return node;
+
+ isl_space *space = isl_schedule_node_band_get_space (node);
+ unsigned dims = isl_space_dim (space, isl_dim_set);
+ isl_schedule_node *child = isl_schedule_node_get_child (node, 0);
+ isl_schedule_node_type type = isl_schedule_node_get_type (child);
+ isl_space_free (space);
+ isl_schedule_node_free (child);
+
+ if (type != isl_schedule_node_leaf)
+ return node;
+
+ if (dims <= 1 || !isl_schedule_node_band_get_permutable (node))
+ {
+ if (dump_file && dump_flags)
+ fprintf (dump_file, "not tiled\n");
+ return node;
+ }
+
+ /* Tile loops. */
+ space = isl_schedule_node_band_get_space (node);
+ isl_multi_val *sizes = isl_multi_val_zero (space);
+ long tile_size = PARAM_VALUE (PARAM_LOOP_BLOCK_TILE_SIZE);
+ isl_ctx *ctx = isl_schedule_node_get_ctx (node);
+
+ for (unsigned i = 0; i < dims; i++)
+ {
+ sizes = isl_multi_val_set_val (sizes, i,
+ isl_val_int_from_si (ctx, tile_size));
+ if (dump_file && dump_flags)
+ fprintf (dump_file, "tiled by %ld\n", tile_size);
+ }
+
+ node = isl_schedule_node_band_tile (node, sizes);
+ node = isl_schedule_node_child (node, 0);
+
+ return node;
+}
+
static isl_union_set *
scop_get_domains (scop_p scop)
{
@@ -83,6 +133,7 @@ optimize_isl (scop_p scop)
sc = isl_schedule_constraints_set_validity (sc, isl_union_map_copy (validity));
sc = isl_schedule_constraints_set_coincidence (sc, validity);
+ isl_options_set_tile_scale_tile_loops (scop->isl_context, 32);
isl_options_set_schedule_serialize_sccs (scop->isl_context, 0);
isl_options_set_schedule_maximize_band_depth (scop->isl_context, 1);
isl_options_set_schedule_max_constant_term (scop->isl_context, 20);
@@ -95,6 +146,9 @@ optimize_isl (scop_p scop)
isl_options_set_ast_build_atomic_upper_bound (scop->isl_context, 1);
scop->transformed_schedule = isl_schedule_constraints_compute_schedule (sc);
+ scop->transformed_schedule =
+ isl_schedule_map_schedule_node_bottom_up (scop->transformed_schedule,
+ get_schedule_for_node_st, NULL);
isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_ABORT);
isl_ctx_reset_operations (scop->isl_context);
diff --git a/gcc/params.def b/gcc/params.def
index 9b82164..98081b9 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -833,7 +833,7 @@ DEFPARAM (PARAM_SWITCH_CONVERSION_BRANCH_RATIO,
DEFPARAM (PARAM_LOOP_BLOCK_TILE_SIZE,
"loop-block-tile-size",
"size of tiles for loop blocking.",
- 51, 0, 0)
+ 32, 0, 0)
/* Maximal number of parameters that we allow in a SCoP. */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-1.c b/gcc/testsuite/gcc.dg/graphite/block-1.c
index 03a5f83..2758404 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-1.c
@@ -45,4 +45,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-5.c b/gcc/testsuite/gcc.dg/graphite/block-5.c
index 95f08c7..24b92c1 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-5.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-5.c
@@ -55,4 +55,4 @@ main (void)
}
/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "codegen error: reverting back to the original code" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-6.c b/gcc/testsuite/gcc.dg/graphite/block-6.c
index 0418a34..e7f1e34 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-6.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-6.c
@@ -49,4 +49,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "codegen error: reverting back to the original code" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-pr47654.c b/gcc/testsuite/gcc.dg/graphite/block-pr47654.c
index c4ffca3..2027a3f 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-pr47654.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-pr47654.c
@@ -21,4 +21,4 @@ main ()
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-0.c b/gcc/testsuite/gcc.dg/graphite/interchange-0.c
index 3f398ca..f655e84 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-0.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-0.c
@@ -46,4 +46,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "2" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "2" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-12.c b/gcc/testsuite/gcc.dg/graphite/interchange-12.c
index 0012d56..7cdbabe 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-12.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-12.c
@@ -53,5 +53,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "2" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-14.c b/gcc/testsuite/gcc.dg/graphite/interchange-14.c
index 917e679..617659c 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-14.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-14.c
@@ -54,5 +54,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "2" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-15.c b/gcc/testsuite/gcc.dg/graphite/interchange-15.c
index 8e147ad..4bd354a 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-15.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-15.c
@@ -48,4 +48,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "2" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-5.c b/gcc/testsuite/gcc.dg/graphite/interchange-5.c
index e578e17..4410a17 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-5.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-5.c
@@ -46,4 +46,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "2" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "2" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-6.c b/gcc/testsuite/gcc.dg/graphite/interchange-6.c
index 9760ed3..c4500cb 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-6.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-6.c
@@ -47,4 +47,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "2" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "2" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-8.c b/gcc/testsuite/gcc.dg/graphite/interchange-8.c
index c623a32..977bc60 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-8.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-8.c
@@ -82,5 +82,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "codegen error: reverting back to the original code" "1" "graphite" } } */
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c b/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
index ec6a983..b97602b 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
@@ -58,4 +58,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "2" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/uns-block-1.c b/gcc/testsuite/gcc.dg/graphite/uns-block-1.c
index 19f358d..5b61eea 100644
--- a/gcc/testsuite/gcc.dg/graphite/uns-block-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/uns-block-1.c
@@ -45,4 +45,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c
index 2b957f5..a53c98e 100644
--- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c
+++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c
@@ -54,5 +54,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "2" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c
index 960e7ae..1e180c6 100644
--- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c
+++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c
@@ -55,5 +55,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "2" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c
index 5c5597f..dcf4738 100644
--- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c
+++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c
@@ -49,4 +49,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "2" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c
index 153fc8e..8f9111a 100644
--- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c
+++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c
@@ -59,4 +59,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "2" "graphite" } } */
+/* { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } } */
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr14741.f90 b/gcc/testsuite/gfortran.dg/graphite/pr14741.f90
index 057e57e..50c2e79 100644
--- a/gcc/testsuite/gfortran.dg/graphite/pr14741.f90
+++ b/gcc/testsuite/gfortran.dg/graphite/pr14741.f90
@@ -24,4 +24,4 @@ SUBROUTINE mult(A,B,C,N)
ENDDO
END SUBROUTINE mult
-! { dg-final { scan-tree-dump-times "isl optimized schedule is identical to the original schedule" "1" "graphite" } }
+! { dg-final { scan-tree-dump-times "isl AST to Gimple succeeded" "1" "graphite" } }
--
2.5.0
next prev parent reply other threads:[~2016-01-15 17:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 17:14 [PATCH 01/15] add more coalescing to simplify constraints Sebastian Pop
2016-01-15 17:15 ` [PATCH 05/15] remove tiling Sebastian Pop
2016-01-15 17:15 ` [PATCH 02/15] remove unused variable Sebastian Pop
2016-01-15 17:15 ` [PATCH 11/15] check for unstructured control flow Sebastian Pop
2016-01-15 17:15 ` [PATCH 07/15] check that all loops are valid in the combined region Sebastian Pop
2016-01-15 17:15 ` [PATCH 10/15] rewrite computation of iteration domains Sebastian Pop
2016-01-15 17:15 ` [PATCH 06/15] fix codegen error exposed by compute isl flow patch Sebastian Pop
2016-01-15 17:15 ` [PATCH 03/15] fix PR68343: disable graphite tests for isl 0.14 or earlier Sebastian Pop
2016-01-15 17:15 ` Sebastian Pop [this message]
2016-01-15 17:15 ` [PATCH 09/15] fix memory leak in scop-detection Sebastian Pop
2016-01-15 17:15 ` [PATCH 08/15] record loops in execution order Sebastian Pop
2016-01-15 17:15 ` [PATCH 04/15] add missing ast node for isl 0.15 Sebastian Pop
2016-01-15 17:16 ` [PATCH 12/15] new scop schedule Sebastian Pop
2016-01-21 14:22 ` [PATCH 01/15] add more coalescing to simplify constraints Matthew Wahab
2016-01-21 14:33 ` Matthew Wahab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452878086-19297-13-git-send-email-sebpop@gmail.com \
--to=spop@codeaurora.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=hiraditya@msn.com \
--cc=richard.guenther@gmail.com \
--cc=sebpop@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).