Add transform_to_exit_first_loop_alt dump success message
2015-07-24 Tom de Vries <tom@codesourcery.com> * tree-parloops.c (gen_parallel_loop): Add debug print for alternative exit-first loop transform. * gcc.dg/parloops-exit-first-loop-alt-2.c: Use debug print for alternative exit-first loop transform. * gcc.dg/parloops-exit-first-loop-alt-3.c: Same. * gcc.dg/parloops-exit-first-loop-alt-4.c: Same. * gcc.dg/parloops-exit-first-loop-alt-5.c: Same. * gcc.dg/parloops-exit-first-loop-alt-6.c: Same. * gcc.dg/parloops-exit-first-loop-alt-7.c: Same. * gcc.dg/parloops-exit-first-loop-alt-pr66652.c: Same. * gcc.dg/parloops-exit-first-loop-alt.c: Same. * gfortran.dg/parloops-exit-first-loop-alt-2.f95: Same. * gfortran.dg/parloops-exit-first-loop-alt.f95: Same. From-SVN: r226164
This commit is contained in:
parent
68180ebadd
commit
a5a57bf378
@ -1,3 +1,8 @@
|
||||
2015-07-24 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
* tree-parloops.c (gen_parallel_loop): Add debug print for alternative
|
||||
exit-first loop transform.
|
||||
|
||||
2015-07-24 Cesar Philippidis <cesar@codesourcery.com>
|
||||
|
||||
PR 66714
|
||||
|
@ -1,3 +1,17 @@
|
||||
2015-07-24 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
* gcc.dg/parloops-exit-first-loop-alt-2.c: Use debug print for
|
||||
alternative exit-first loop transform.
|
||||
* gcc.dg/parloops-exit-first-loop-alt-3.c: Same.
|
||||
* gcc.dg/parloops-exit-first-loop-alt-4.c: Same.
|
||||
* gcc.dg/parloops-exit-first-loop-alt-5.c: Same.
|
||||
* gcc.dg/parloops-exit-first-loop-alt-6.c: Same.
|
||||
* gcc.dg/parloops-exit-first-loop-alt-7.c: Same.
|
||||
* gcc.dg/parloops-exit-first-loop-alt-pr66652.c: Same.
|
||||
* gcc.dg/parloops-exit-first-loop-alt.c: Same.
|
||||
* gfortran.dg/parloops-exit-first-loop-alt-2.f95: Same.
|
||||
* gfortran.dg/parloops-exit-first-loop-alt.f95: Same.
|
||||
|
||||
2015-07-24 Ilya Enkovich <enkovich.gnu@gmail.com>
|
||||
|
||||
PR ipa/66566
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
/* Constant bound, vector addition. */
|
||||
|
||||
@ -19,9 +19,4 @@ f (void)
|
||||
c[i] = a[i] + b[i];
|
||||
}
|
||||
|
||||
/* Three times three array accesses:
|
||||
- three in f._loopfn.0
|
||||
- three in the parallel
|
||||
- three in the low iteration count loop
|
||||
Crucially, none for a peeled off last iteration following the parallel. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)\\\[i" 9 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
/* Variable bound, reduction. */
|
||||
|
||||
@ -18,9 +18,4 @@ f (unsigned int n, unsigned int *__restrict__ a)
|
||||
return sum;
|
||||
}
|
||||
|
||||
/* Three array accesses:
|
||||
- one in f._loopfn.0
|
||||
- one in the parallel
|
||||
- one in the low iteration count loop
|
||||
Crucially, none for a peeled off last iteration following the parallel. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)\\\* 4" 3 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
/* Constant bound, reduction. */
|
||||
|
||||
@ -20,9 +20,4 @@ f (void)
|
||||
return sum;
|
||||
}
|
||||
|
||||
/* Three array accesses:
|
||||
- one in f._loopfn.0
|
||||
- one in the parallel
|
||||
- one in the low iteration count loop
|
||||
Crucially, none for a peeled off last iteration following the parallel. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)\\\* 4" 3 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
/* Variable bound, vector addition, unsigned loop counter, unsigned bound. */
|
||||
|
||||
@ -14,9 +14,4 @@ f (unsigned int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,
|
||||
c[i] = a[i] + b[i];
|
||||
}
|
||||
|
||||
/* Three times a store:
|
||||
- one in f._loopfn.0
|
||||
- one in the parallel
|
||||
- one in the low iteration count loop
|
||||
Crucially, none for a peeled off last iteration following the parallel. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
/* Variable bound, vector addition, unsigned loop counter, signed bound. */
|
||||
|
||||
@ -14,9 +14,4 @@ f (int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,
|
||||
c[i] = a[i] + b[i];
|
||||
}
|
||||
|
||||
/* Three times a store:
|
||||
- one in f._loopfn.0
|
||||
- one in the parallel
|
||||
- one in the low iteration count loop
|
||||
Crucially, none for a peeled off last iteration following the parallel. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
/* Variable bound, vector addition, signed loop counter, signed bound. */
|
||||
|
||||
@ -14,9 +14,4 @@ f (int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,
|
||||
c[i] = a[i] + b[i];
|
||||
}
|
||||
|
||||
/* Three times a store:
|
||||
- one in f._loopfn.0
|
||||
- one in the parallel
|
||||
- one in the low iteration count loop
|
||||
Crucially, none for a peeled off last iteration following the parallel. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -22,10 +22,5 @@ f (unsigned int n, unsigned int sum)
|
||||
return sum;
|
||||
}
|
||||
|
||||
/* Four times % 13:
|
||||
- once in f._loopfn.0
|
||||
- once in the parallel
|
||||
- once in the low iteration count loop
|
||||
- once for a peeled off last iteration following the parallel.
|
||||
In other words, we want try_transform_to_exit_first_loop_alt to fail. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)% 13" 4 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 1 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 0 "parloops" } } */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target pthread } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops" } */
|
||||
/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||
|
||||
/* Variable bound, vector addition, signed loop counter, unsigned bound. */
|
||||
|
||||
@ -14,9 +14,5 @@ f (unsigned int n, unsigned int *__restrict__ a, unsigned int *__restrict__ b,
|
||||
c[i] = a[i] + b[i];
|
||||
}
|
||||
|
||||
/* Three times a store:
|
||||
- one in f._loopfn.0
|
||||
- one in the parallel
|
||||
- one in the low iteration count loop
|
||||
Crucially, none for a peeled off last iteration following the parallel. */
|
||||
/* { dg-final { scan-tree-dump-times "(?n)^ \\*_\[0-9\]*" 3 "parloops" } } */
|
||||
/* { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } } */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
! { dg-additional-options "-O2" }
|
||||
! { dg-require-effective-target pthread }
|
||||
! { dg-additional-options "-ftree-parallelize-loops=2" }
|
||||
! { dg-additional-options "-fdump-tree-parloops" }
|
||||
! { dg-additional-options "-fdump-tree-parloops-details" }
|
||||
|
||||
! Constant bound, vector addition.
|
||||
|
||||
@ -16,9 +16,4 @@ subroutine foo ()
|
||||
end do
|
||||
end subroutine foo
|
||||
|
||||
! Three times plus 25:
|
||||
! - once in f._loopfn.0
|
||||
! - once in the parallel
|
||||
! - once in the low iteration count loop
|
||||
! Crucially, none for a peeled off last iteration following the parallel.
|
||||
! { dg-final { scan-tree-dump-times "(?n) \\+ 25;" 3 "parloops" } }
|
||||
! { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } }
|
||||
|
@ -1,7 +1,7 @@
|
||||
! { dg-additional-options "-O2" }
|
||||
! { dg-require-effective-target pthread }
|
||||
! { dg-additional-options "-ftree-parallelize-loops=2" }
|
||||
! { dg-additional-options "-fdump-tree-parloops" }
|
||||
! { dg-additional-options "-fdump-tree-parloops-details" }
|
||||
|
||||
! Variable bound, vector addition.
|
||||
|
||||
@ -17,9 +17,5 @@ subroutine foo (nr)
|
||||
end do
|
||||
end subroutine foo
|
||||
|
||||
! Three times plus 25:
|
||||
! - once in f._loopfn.0
|
||||
! - once in the parallel
|
||||
! - once in the low iteration count loop
|
||||
! Crucially, none for a peeled off last iteration following the parallel.
|
||||
! { dg-final { scan-tree-dump-times "(?n) \\+ 25;" 3 "parloops" } }
|
||||
! { dg-final { scan-tree-dump-times "alternative exit-first loop transform succeeded" 1 "parloops" } }
|
||||
|
||||
|
@ -2246,7 +2246,15 @@ gen_parallel_loop (struct loop *loop,
|
||||
increment) and immediately follows the loop exit test. Attempt to move the
|
||||
entry of the loop directly before the exit check and increase the number of
|
||||
iterations of the loop by one. */
|
||||
if (!try_transform_to_exit_first_loop_alt (loop, reduction_list, nit))
|
||||
if (try_transform_to_exit_first_loop_alt (loop, reduction_list, nit))
|
||||
{
|
||||
if (dump_file
|
||||
&& (dump_flags & TDF_DETAILS))
|
||||
fprintf (dump_file,
|
||||
"alternative exit-first loop transform succeeded"
|
||||
" for loop %d\n", loop->num);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fall back on the method that handles more cases, but duplicates the
|
||||
loop body: move the exit condition of LOOP to the beginning of its
|
||||
|
Loading…
Reference in New Issue
Block a user