diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-10-23 19:56:19 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@linaro.org> | 2017-10-23 19:56:19 +0100 |
commit | 7bef5b82e4109778a0988d20e19e1ed29dadd835 (patch) | |
tree | f5c594a5206e2b23c95741c1338fc1d11acffd25 /gcc/testsuite/gcc.dg/graphite | |
parent | 246229fdf9230ca040aa990a3fbb42698f30ae5f (diff) | |
parent | b11bf8d85f574c56cab353544b50396c18ab9b93 (diff) | |
download | gcc-7bef5b82e4109778a0988d20e19e1ed29dadd835.tar.gz |
Merge trunk into sve
Diffstat (limited to 'gcc/testsuite/gcc.dg/graphite')
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/fuse-1.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/fuse-2.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/id-30.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr69728.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr82451.c | 21 |
5 files changed, 54 insertions, 11 deletions
diff --git a/gcc/testsuite/gcc.dg/graphite/fuse-1.c b/gcc/testsuite/gcc.dg/graphite/fuse-1.c index e3bf7bcf99b..204d3b20703 100644 --- a/gcc/testsuite/gcc.dg/graphite/fuse-1.c +++ b/gcc/testsuite/gcc.dg/graphite/fuse-1.c @@ -1,15 +1,15 @@ /* 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-forwprop4-all -fdump-tree-graphite-all" } */ +/* { dg-options "-O2 -floop-nest-optimize -fdump-tree-forwprop-all -fdump-tree-graphite-all" } */ /* Make sure we fuse the loops like this: AST generated by isl: for (int c0 = 0; c0 <= 99; c0 += 1) { - S_3(0, c0); - S_6(0, c0); - S_9(0, c0); + S_3(c0); + S_6(c0); + S_9(c0); } */ -/* { dg-final { scan-tree-dump-times "AST generated by isl:.*for \\(int c0 = 0; c0 <= 99; c0 \\+= 1\\) \\{.*S_.*\\(0, c0\\);.*S_.*\\(0, c0\\);.*S_.*\\(0, c0\\);.*\\}" 1 "graphite" } } */ +/* { dg-final { scan-tree-dump-times "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" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/fuse-2.c b/gcc/testsuite/gcc.dg/graphite/fuse-2.c index dc0a9b2b61c..f4cea4360d9 100644 --- a/gcc/testsuite/gcc.dg/graphite/fuse-2.c +++ b/gcc/testsuite/gcc.dg/graphite/fuse-2.c @@ -3,13 +3,13 @@ /* Make sure we fuse the loops like this: AST generated by isl: for (int c0 = 0; c0 <= 99; c0 += 1) { - S_3(0, c0); - S_6(0, c0); - S_9(0, c0); + S_3(c0); + S_6(c0); + S_9(c0); } */ -/* { dg-final { scan-tree-dump-times "AST generated by isl:.*for \\(int c0 = 0; c0 <= 99; c0 \\+= 1\\) \\{.*S_.*\\(0, c0\\);.*S_.*\\(0, c0\\);.*S_.*\\(0, c0\\);.*\\}" 1 "graphite" } } */ +/* { dg-final { scan-tree-dump-times "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]; diff --git a/gcc/testsuite/gcc.dg/graphite/id-30.c b/gcc/testsuite/gcc.dg/graphite/id-30.c new file mode 100644 index 00000000000..f8144cec4f2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/id-30.c @@ -0,0 +1,16 @@ +/* The modulo constraints we generate for the niter expression + (unsinged long)ubound - (unsigned long)lbound + end up with a modulo that we cannot represent in the expression + type we are using (int64_t), so we run into the codegen error + where ISL generates a modulo/divide by sth that doesn't fit the + type we code-generate with. Verify we properly elide those. */ + +void foo (double *a, long int lbound0, long int ubound0, + long int lbound1, long int ubound1, long int stride1) +{ + if (lbound0 < ubound0) + for (long int i = lbound0; i <= ubound0; ++i) + if (lbound1 < ubound1) + for (long int j = lbound1; j <= ubound1; ++j) + a[i*stride1 + j] = 0.; +} diff --git a/gcc/testsuite/gcc.dg/graphite/pr69728.c b/gcc/testsuite/gcc.dg/graphite/pr69728.c index 35ea5bd15bb..e8cd7bec0a1 100644 --- a/gcc/testsuite/gcc.dg/graphite/pr69728.c +++ b/gcc/testsuite/gcc.dg/graphite/pr69728.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -floop-nest-optimize" } */ +/* { dg-options "-O3 -floop-nest-optimize -fdump-tree-graphite-details" } */ -int a[1]; +int a[9]; int b, c, d, e; void fn1 () @@ -19,3 +19,9 @@ fn1 () } } } + +/* At the moment only ISL figures that if (d) is always true. We've + run into scheduling issues before here, not being able to handle + empty domains. */ + +/* { dg-final { scan-tree-dump "loop nest optimized" "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/pr82451.c b/gcc/testsuite/gcc.dg/graphite/pr82451.c new file mode 100644 index 00000000000..802b931fddd --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr82451.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O -floop-parallelize-all" } */ + +static int a[]; +int b[1]; +int c; +static void +d (int *f, int *g) +{ + int e; + for (e = 0; e < 2; e++) + g[e] = 1; + for (e = 0; e < 2; e++) + g[e] = f[e] + f[e + 1]; +} +void +h () +{ + for (;; c += 8) + d (&a[c], b); +} |