diff options
author | Aditya Kumar <aditya.k7@samsung.com> | 2015-11-06 20:43:46 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2015-11-06 20:43:46 +0000 |
commit | 40856c71be57cd32733304904d74e5ffe221623d (patch) | |
tree | 448efbb90c0a097a75b4f1bcf06f96cf9375e643 /gcc | |
parent | 1167ebe707eae615a2d16fe06edf5e1904a71c33 (diff) | |
download | gcc-40856c71be57cd32733304904d74e5ffe221623d.zip gcc-40856c71be57cd32733304904d74e5ffe221623d.tar.gz gcc-40856c71be57cd32733304904d74e5ffe221623d.tar.bz2 |
enable loop fusion on isl-15
* graphite-optimize-isl.c (optimize_isl): Call
isl_options_set_schedule_maximize_band_depth.
* gcc.dg/graphite/fuse-1.c: New.
* gcc.dg/graphite/fuse-2.c: New.
* gcc.dg/graphite/interchange-13.c: Remove bogus check.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r229889
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/graphite-optimize-isl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/fuse-1.c | 43 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/fuse-2.c | 43 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/interchange-13.c | 1 |
6 files changed, 103 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 906dc94..04bc2b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,11 +1,17 @@ 2015-11-06 Aditya Kumar <aditya.k7@samsung.com> Sebastian Pop <s.pop@samsung.com> - * graphite-scop-detection.c (scop_detection::merge_sese): Entry + * graphite-optimize-isl.c (optimize_isl): Call + isl_options_set_schedule_maximize_band_depth. + +2015-11-06 Aditya Kumar <aditya.k7@samsung.com> + Sebastian Pop <s.pop@samsung.com> + + * graphite-scop-detection.c (scop_detection::merge_sese): Entry and exit edges should not be a part of irreducible loop. - (scop_detection::can_represent_loop_1): Loops should not be + (scop_detection::can_represent_loop_1): Loops should not be irreducible. - (scop_detection::harmful_stmt_in_region): All the basic block + (scop_detection::harmful_stmt_in_region): All the basic block should belong to reducible loops. 2015-11-06 Christophe Lyon <christophe.lyon@linaro.org> diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c index 53355bb..0d85975 100644 --- a/gcc/graphite-optimize-isl.c +++ b/gcc/graphite-optimize-isl.c @@ -404,7 +404,7 @@ optimize_isl (scop_p scop) isl_options_set_schedule_maximize_band_depth (scop->isl_context, 1); #ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS /* ISL-0.15 or later. */ - isl_options_set_schedule_serialize_sccs (scop->isl_context, 1); + isl_options_set_schedule_maximize_band_depth (scop->isl_context, 1); #else isl_options_set_schedule_fuse (scop->isl_context, ISL_SCHEDULE_FUSE_MIN); #endif diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 564b45a..4af2022 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-11-06 Aditya Kumar <aditya.k7@samsung.com> + Sebastian Pop <s.pop@samsung.com> + + * gcc.dg/graphite/fuse-1.c: New. + * gcc.dg/graphite/fuse-2.c: New. + * gcc.dg/graphite/interchange-13.c: Remove bogus check. + 2015-11-06 Christophe Lyon <christophe.lyon@linaro.org> * gcc.target/aarch64/advsimd-intrinsics/vqtbX.c: New test. diff --git a/gcc/testsuite/gcc.dg/graphite/fuse-1.c b/gcc/testsuite/gcc.dg/graphite/fuse-1.c new file mode 100644 index 0000000..c9bb67d --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/fuse-1.c @@ -0,0 +1,43 @@ +/* Check that the two loops are fused and that we manage to fold the two xor + operations. */ +/* { dg-options "-O2 -floop-nest-optimize -fdump-tree-forwprop-all" } */ +/* { dg-do run } */ + +/* Make sure we fuse the loops like this: +ISL AST generated by ISL: +for (int c0 = 0; c0 <= 99; c0 += 1) { + S_3(c0); + S_6(c0); + S_9(c0); +} +*/ +/* { dg-final { scan-tree-dump-times "ISL AST generated by ISL:.*for (int c0 = 0; c0 <= 99; c0 += 1) \{.*S_.*(c0);.*S_.*(c0);.*S_.*(c0);.*\}" 1 "graphite" } } */ + +/* Check that after fusing the loops, the scalar computation is also fused. */ +/* { dg-final { scan-tree-dump-times "gimple_simplified to\[^\\n\]*\\^ 12" 1 "forwprop4" } } */ + + + +#define MAX 100 +int A[MAX]; + +extern void abort (); + +int +main (void) +{ + int i; + + for (i = 0; i < MAX; i++) + A[i] = i; + for(int i=0; i<MAX; i++) + A[i] ^= 4; + for(int i=0; i<MAX; i++) + A[i] ^= 8; + + for (i = 0; i < MAX; i++) + if (A[i] != (i ^ 12)) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/graphite/fuse-2.c b/gcc/testsuite/gcc.dg/graphite/fuse-2.c new file mode 100644 index 0000000..aaa5e2f --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/fuse-2.c @@ -0,0 +1,43 @@ +/* Check that the three loops are fused. */ +/* { dg-options "-O2 -floop-nest-optimize" } */ +/* { dg-do run } */ + +/* Make sure we fuse the loops like this: +ISL AST generated by ISL: +for (int c0 = 0; c0 <= 99; c0 += 1) { + S_3(c0); + S_6(c0); + S_9(c0); +} +*/ + +/* { dg-final { scan-tree-dump-times "ISL AST generated by ISL:.*for (int c0 = 0; c0 <= 99; c0 += 1) \{.*S_.*(c0);.*S_.*(c0);.*S_.*(c0);.*\}" 1 "graphite" } } */ + +#define MAX 100 +int A[MAX], B[MAX], C[MAX]; + +extern void abort (); + +int +main (void) +{ + int i; + + /* The next three loops should be fused. */ + for (i = 0; i < MAX; i++) + { + A[i] = i; + B[i] = i + 2; + C[i] = i + 1; + } + for(int i=0; i<MAX; i++) + A[i] += B[i]; + for(int i=0; i<MAX; i++) + A[i] += C[i]; + + for (i = 0; i < MAX; i++) + if (A[i] != 3*i+3) + abort (); + + return 0; +} diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-13.c b/gcc/testsuite/gcc.dg/graphite/interchange-13.c index 3398de2..4e4a83e 100644 --- a/gcc/testsuite/gcc.dg/graphite/interchange-13.c +++ b/gcc/testsuite/gcc.dg/graphite/interchange-13.c @@ -49,4 +49,3 @@ main (void) return 0; } -/* { dg-final { scan-tree-dump "tiled" "graphite" } } */ |