This is the mail archive of the
mailing list for the GCC project.
Fortran's DO CONCURRENT - make use of it middle-end-wise
- From: Tobias Burnus <burnus at net-b dot de>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Sun, 04 Sep 2011 10:47:37 +0200
- Subject: Fortran's DO CONCURRENT - make use of it middle-end-wise
Fortran 2008 has a do concurrent construct, where the programmer
guarantees that the result is independent of the order; e.g.
do concurrent (i = 1:10:2) ! from, to, step/stride
A(i) = sin(B(i))
can be run as i = 1, 3, 5, 7, 9; in any permutation or in parallel.
The plan is to translate it as normal loop; however, it would be useful
if this non-order-dependence could be used by the middle end (general
optimization or at least for -floop-parallelize-all /
-ftree-parallelize-loops). Is there a way to tell the middle-end about
PS: By default, do concurrent loops will run consecutively, but I was
thinking of optionally using OpenMP parallelization for those by
explicitly adding an OMP directive. The do-concurrent parsing/resolving
patch is at http://gcc.gnu.org/ml/fortran/2011-09/msg00002.html. The
tree-generating part still needs to be written, but should be simple
(for the serial case).