Commit 9e517d61 by Li Feng Committed by Sebastian Pop

re PR middle-end/39500 (autopar fails to parallel)

2009-03-19  Li Feng  <nemokingdom@gmail.com>

	PR middle-end/39500
	* tree-data-ref.c (analyze_subscript_affine_affine): There is no
	dependence if the first conflict is after niter iterations.

testsuite/
	* gcc.dg/autopar/pr39500-1.c: New.
	* gcc.dg/autopar/pr39500-2.c: New.

From-SVN: r144952
parent 8ef20026
2009-03-19 Li Feng <nemokingdom@gmail.com>
PR middle-end/39500
* tree-data-ref.c (analyze_subscript_affine_affine): There is no
dependence if the first conflict is after niter iterations.
2009-03-19 Hans-Peter Nilsson <hp@axis.com>
PR middle-end/38609
......
2009-03-19 Li Feng <nemokingdom@gmail.com>
PR middle-end/39500
* gcc.dg/autopar/pr39500-1.c: New.
* gcc.dg/autopar/pr39500-2.c: New.
2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
* g++.dg/dg.exp: Prune graphite.
......
/* pr39500: autopar fails to parallel */
/* origin: nemokingdom@gmail.com(LiFeng) */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */
void abort (void);
int main (void)
{
int i;
int x[1000];
for (i = 0; i < 100; i++)
x[i] = x[i+100];
for (i = 0; i < 100; i++)
{
if (x[i] != x[i+100])
abort ();
}
return 0;
}
/* Check that the first loop in parloop got parallelized. */
/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */
/* pr39500: autopar fails to parallel */
/* origin: nemokingdom@gmail.com(LiFeng) */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details" } */
int main (void)
{
int i;
int x[1000];
for (i = 0; i < 101; i++)
x[i] = x[i+100];
return x[12];
}
/* This loop cannot be parallelized due to a dependence. */
/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */
......@@ -2302,7 +2302,7 @@ analyze_subscript_affine_affine (tree chrec_a,
/* If the overlap occurs outside of the bounds of the
loop, there is no dependence. */
if (x1 > niter || y1 > niter)
if (x1 >= niter || y1 >= niter)
{
*overlaps_a = conflict_fn_no_dependence ();
*overlaps_b = conflict_fn_no_dependence ();
......
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