diff options
author | Sebastian Pop <spop@gcc.gnu.org> | 2010-01-07 18:33:01 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-01-07 18:33:01 +0000 |
commit | 11d6ea5e1da0876047915162678967b0cb90ec49 (patch) | |
tree | 6f83ba20e9cf8193ffdaaae85927a545b30222fe | |
parent | 556afcdc1107b79c8f037cc1f9dc4f5a220ff8e4 (diff) | |
download | gcc-11d6ea5e1da0876047915162678967b0cb90ec49.zip gcc-11d6ea5e1da0876047915162678967b0cb90ec49.tar.gz gcc-11d6ea5e1da0876047915162678967b0cb90ec49.tar.bz2 |
Update loop-block testcases.
2010-01-06 Sebastian Pop <sebastian.pop@amd.com>
* graphite-blocking.c (scop_do_block): Print "SCoP will be loop
blocked" only when both the strip mine and the interchange have
been applied.
* testsuite/gcc.dg/graphite/block-2.c: Removed.
* testsuite/gcc.dg/graphite/block-3.c: Add scan pattern.
* testsuite/gcc.dg/graphite/block-4.c: Same.
* testsuite/gcc.dg/graphite/block-5.c: Same.
* testsuite/gcc.dg/graphite/block-6.c: Same.
From-SVN: r155703
-rw-r--r-- | gcc/ChangeLog.graphite | 18 | ||||
-rw-r--r-- | gcc/graphite-blocking.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/block-2.c | 29 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/block-3.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/block-4.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/block-5.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/block-6.c | 16 |
7 files changed, 45 insertions, 52 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 780f23e..f9c6603 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,21 @@ +2010-01-07 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/42641 + * sese.c (rename_map_elt_info): Use the SSA name version, do + not hash pointers. + +2010-01-06 Sebastian Pop <sebastian.pop@amd.com> + + * graphite-blocking.c (scop_do_block): Print "SCoP will be loop + blocked" only when both the strip mine and the interchange have + been applied. + + * testsuite/gcc.dg/graphite/block-2.c: Removed. + * testsuite/gcc.dg/graphite/block-3.c: Add scan pattern. + * testsuite/gcc.dg/graphite/block-4.c: Same. + * testsuite/gcc.dg/graphite/block-5.c: Same. + * testsuite/gcc.dg/graphite/block-6.c: Same. + 2010-01-06 Sebastian Pop <sebastian.pop@amd.com> * graphite-clast-to-gimple.c (save_clast_name_index): Free slot diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c index 3cf60e9..f7ddae2 100644 --- a/gcc/graphite-blocking.c +++ b/gcc/graphite-blocking.c @@ -285,25 +285,27 @@ scop_do_strip_mine (scop_p scop) bool scop_do_block (scop_p scop) { - bool transform_done = false; + bool strip_mined = false; + bool interchanged = false; store_scattering (scop); - lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); - transform_done = scop_do_interchange (scop); + strip_mined = lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); + interchanged = 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 + if (!interchanged || !graphite_legal_transform (scop)) { restore_scattering (scop); return false; } - else if (dump_file && (dump_flags & TDF_DETAILS)) + else if (strip_mined && interchanged + && dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "SCoP will be loop blocked.\n"); - return transform_done; + return strip_mined || interchanged; } #endif diff --git a/gcc/testsuite/gcc.dg/graphite/block-2.c b/gcc/testsuite/gcc.dg/graphite/block-2.c deleted file mode 100644 index 210ea34..0000000 --- a/gcc/testsuite/gcc.dg/graphite/block-2.c +++ /dev/null @@ -1,29 +0,0 @@ -typedef unsigned char UChar; -typedef int Int32; -typedef unsigned int UInt32; - -void fallbackSort ( UInt32* fmap, - UInt32* eclass, - Int32 nblock, - Int32 verb ) -{ - Int32 ftab[257]; - Int32 ftabCopy[256]; - Int32 H, i, j, k, l, r, cc, cc1; - Int32 nNotDone; - Int32 nBhtab; - UChar* eclass8 = (UChar*)eclass; - - if (verb >= 4) - VPrintf0 ( " bucket sorting ...\n" ); - for (i = 0; i < 257; i++) ftab[i] = 0; - for (i = 0; i < nblock; i++) ftab[eclass8[i]]++; - for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i]; - for (i = 1; i < 257; i++) ftab[i] += ftab[i-1]; - - for (i = 0; i < nblock; i++) { - j = eclass8[i] + ftab [i]; - } - AssertH ( j < 256, 1005 ); -} -/* { dg-final { cleanup-tree-dump "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/block-3.c b/gcc/testsuite/gcc.dg/graphite/block-3.c index 06eecfb..7535616 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-3.c +++ b/gcc/testsuite/gcc.dg/graphite/block-3.c @@ -9,17 +9,18 @@ void test (void) { int i, j, k; - /* These loops contain too few iterations for being strip-mined by 64. */ + /* These loops contain too few iterations to be blocked by 64. */ for (i = 0; i < 24; i++) for (j = 0; j < 24; j++) for (k = 0; k < 24; k++) A[i][j][k] = B[i][k] * C[k][j]; - /* These loops should still be strip mined. */ + /* These loops should still be loop blocked. */ for (i = 0; i < M; i++) for (j = 0; j < M; j++) for (k = 0; k < M; k++) A[i][j][k] = B[i][k] * C[k][j]; } +/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/block-4.c b/gcc/testsuite/gcc.dg/graphite/block-4.c index 26b088e..d752a4d 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-4.c +++ b/gcc/testsuite/gcc.dg/graphite/block-4.c @@ -20,4 +20,5 @@ void test (void) A[i][j] = B[i][k] * C[k][j]; } +/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/block-5.c b/gcc/testsuite/gcc.dg/graphite/block-5.c index 5b22630..a8f3817 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-5.c +++ b/gcc/testsuite/gcc.dg/graphite/block-5.c @@ -8,19 +8,19 @@ int test () int b[N][N]; unsigned i, j; - for (i = 0; i < N; i++) + for (i = 0; i < N; i++) for (j = 0; j < N; j++) a[i][j] = i*j; - for (j = 1; j < N; j++) + /* This loop nest should be blocked. */ + for (j = 1; j < N; j++) for (i = 0; i < N; i++) a[i][j] = a[i][j-1] + b[i][j]; - for (i = 0; i < N; i++) - for (j = 0; j < N; j++) - foo (a[i][j]); + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + foo (a[i][j]); } -/* Interchange is legal for loops 0 and 1 of the first two SCoPs */ -/* { dg-final { scan-tree-dump-times "Interchange valid for loops 0 and 1:" 2 "graphite" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */ diff --git a/gcc/testsuite/gcc.dg/graphite/block-6.c b/gcc/testsuite/gcc.dg/graphite/block-6.c index 1c92e39..6905e36 100644 --- a/gcc/testsuite/gcc.dg/graphite/block-6.c +++ b/gcc/testsuite/gcc.dg/graphite/block-6.c @@ -7,19 +7,19 @@ int test () int a[N][N]; unsigned i, j; - for (i = 0; i < N; i++) + for (i = 0; i < N; i++) for (j = 0; j < N; j++) - a[i][j] = i*j; + a[i][j] = i*j; - for (i = 1; i < N; i++) + /* Interchange is not legal for loops 0 and 1. */ + for (i = 1; i < N; i++) for (j = 1; j < (N-1) ; j++) - a[i][j] = a[i-1][j+1] * a[i-1][j+1]/2; + a[i][j] = a[i-1][j+1] * a[i-1][j+1]/2; - for (i = 0; i < N; i++) + for (i = 0; i < N; i++) for (j = 0; j < N; j++) - foo (a[i][j]); + foo (a[i][j]); } -/* Interchange is not legal for loops 0 and 1 of SCoP 2. */ -/* { dg-final { scan-tree-dump-times "Interchange not valid for loops 0 and 1:" 1 "graphite" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "will be loop blocked" 0 "graphite" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */ |