Commit 11d6ea5e by Sebastian Pop

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
parent 556afcdc
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> 2010-01-06 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (save_clast_name_index): Free slot * graphite-clast-to-gimple.c (save_clast_name_index): Free slot
......
...@@ -285,25 +285,27 @@ scop_do_strip_mine (scop_p scop) ...@@ -285,25 +285,27 @@ scop_do_strip_mine (scop_p scop)
bool bool
scop_do_block (scop_p scop) scop_do_block (scop_p scop)
{ {
bool transform_done = false; bool strip_mined = false;
bool interchanged = false;
store_scattering (scop); store_scattering (scop);
lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop)); strip_mined = lst_do_strip_mine (SCOP_TRANSFORMED_SCHEDULE (scop));
transform_done = scop_do_interchange (scop); interchanged = scop_do_interchange (scop);
/* If we don't interchange loops, then the strip mine is not /* If we don't interchange loops, then the strip mine is not
profitable, and the transform is not a loop blocking. */ profitable, and the transform is not a loop blocking. */
if (!transform_done if (!interchanged
|| !graphite_legal_transform (scop)) || !graphite_legal_transform (scop))
{ {
restore_scattering (scop); restore_scattering (scop);
return false; 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"); fprintf (dump_file, "SCoP will be loop blocked.\n");
return transform_done; return strip_mined || interchanged;
} }
#endif #endif
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" } } */
...@@ -9,17 +9,18 @@ void test (void) ...@@ -9,17 +9,18 @@ void test (void)
{ {
int i, j, k; 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 (i = 0; i < 24; i++)
for (j = 0; j < 24; j++) for (j = 0; j < 24; j++)
for (k = 0; k < 24; k++) for (k = 0; k < 24; k++)
A[i][j][k] = B[i][k] * C[k][j]; 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 (i = 0; i < M; i++)
for (j = 0; j < M; j++) for (j = 0; j < M; j++)
for (k = 0; k < M; k++) for (k = 0; k < M; k++)
A[i][j][k] = B[i][k] * C[k][j]; 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" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */
...@@ -20,4 +20,5 @@ void test (void) ...@@ -20,4 +20,5 @@ void test (void)
A[i][j] = B[i][k] * C[k][j]; 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" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */
...@@ -8,19 +8,19 @@ int test () ...@@ -8,19 +8,19 @@ int test ()
int b[N][N]; int b[N][N];
unsigned i, j; unsigned i, j;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
for (j = 0; j < N; j++) for (j = 0; j < N; j++)
a[i][j] = i*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++) for (i = 0; i < N; i++)
a[i][j] = a[i][j-1] + b[i][j]; a[i][j] = a[i][j-1] + b[i][j];
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
for (j = 0; j < N; j++) for (j = 0; j < N; j++)
foo (a[i][j]); foo (a[i][j]);
} }
/* Interchange is legal for loops 0 and 1 of the first two SCoPs */ /* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
/* { dg-final { scan-tree-dump-times "Interchange valid for loops 0 and 1:" 2 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */
...@@ -7,19 +7,19 @@ int test () ...@@ -7,19 +7,19 @@ int test ()
int a[N][N]; int a[N][N];
unsigned i, j; unsigned i, j;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
for (j = 0; j < N; j++) 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++) 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++) 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 "will be loop blocked" 0 "graphite" } } */
/* { dg-final { scan-tree-dump-times "Interchange not valid for loops 0 and 1:" 1 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */ /* { dg-final { cleanup-tree-dump "graphite" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment