This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix autopar testcase
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Nov 2012 12:21:10 +0100
- Subject: Fix autopar testcase
Hi,
this testcase tests that we are about to bound number of iterations of
for (k = 3; k < NA_1; k++)
for (i = 3; i < MA_1; i++)
for (j = 3; j < MB_1; j++)
{
t = T[i][j];
T[i][j] = t+2+A[i][k]*B[j][k];
}
based on
#define MB 100
#define NA 450
#define MA 400
int T[MA][MB],A[MA][NA],B[MB][NA];
Well, we used to be able to, but by bug. The problem is that we are not able to hoist
the loop headers prior the loop and thus we do not have perfect nest and we do not know
if the body is always executed on an iteration of the outer loops.
This patch fixes the testcase by hoisting by hand.
I would bet I saw loop-ch.c patch doing this, but I do not see it in mainline?
Comitted.
Honza
*** pr499602.c 2012-11-05 12:18:21.771215185 +0100
--- pr49960.c 2012-11-05 12:17:43.696420662 +0100
***************
*** 11,16 ****
--- 11,21 ----
{
int i,j, t,k;
+ /* At the moment we are not able to hoist the loop headers out of the loop
+ nest. */
+ if (MA_1 < 4 || NA_1 < 4 || MB_1 < 4)
+ return;
+
/* The outer most loop is not parallel because for different k's there
is write-write dependency for T[i][j]. */