r222286 - in /branches/gomp-4_0-branch: gcc/Cha...
tschwinge@gcc.gnu.org
tschwinge@gcc.gnu.org
Tue Apr 21 20:22:00 GMT 2015
Author: tschwinge
Date: Tue Apr 21 20:22:54 2015
New Revision: 222286
URL: https://gcc.gnu.org/viewcvs?rev=222286&root=gcc&view=rev
Log:
Handle global loop counters in fortran oacc kernels
Unable to have loop counters with a scope limited to the kernels region, and
the fact that function scope inhibits parallelization, at the technical level,
it seems possible to do DCE and get rid of the dead code that is inhibiting
parallelization (in other words, the code copying the loop iterator value out
of the region), but probably some effort would be involved.
Another possibility is to add an assign of the final value of the loop
iteration variable after the loop to cut the dependency, though this will only
work for loops where that value is know at compile time -- which is exactly
what pass_scev_cprop does.
gcc/
* passes.def: Add pass_scev_cprop to pass_oacc_kernels.
* tree-ssa-loop.c (pass_scev_cprop::clone): New function.
gcc/testsuite/
* gcc.dg/pr41488.c: Update for new pass_scev_cprop.
* gcc.dg/tree-ssa/loop-17.c: Likewise.
* gcc.dg/tree-ssa/loop-39.c: Likewise.
* gcc.dg/tree-ssa/scev-7.c: Likewise.
* gfortran.dg/goacc/kernels-loop-2.f95: New test.
* gfortran.dg/goacc/kernels-loop.f95: New test.
libgomp/
* testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: New test.
* testsuite/libgomp.oacc-fortran/kernels-loop.f95: New test.
Added:
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/kernels-loop-2.f95
branches/gomp-4_0-branch/gcc/testsuite/gfortran.dg/goacc/kernels-loop.f95
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop-2.f95
branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-fortran/kernels-loop.f95
Modified:
branches/gomp-4_0-branch/gcc/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/passes.def
branches/gomp-4_0-branch/gcc/testsuite/ChangeLog.gomp
branches/gomp-4_0-branch/gcc/testsuite/gcc.dg/pr41488.c
branches/gomp-4_0-branch/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c
branches/gomp-4_0-branch/gcc/testsuite/gcc.dg/tree-ssa/loop-39.c
branches/gomp-4_0-branch/gcc/testsuite/gcc.dg/tree-ssa/scev-7.c
branches/gomp-4_0-branch/gcc/tree-ssa-loop.c
branches/gomp-4_0-branch/libgomp/ChangeLog.gomp
More information about the Gcc-cvs
mailing list