]> git.ipfire.org Git - thirdparty/gcc.git/commit
openacc: Add runtime alias checking for OpenACC kernels
authorAndrew Stubbs <ams@codesourcery.com>
Tue, 16 Nov 2021 15:19:53 +0000 (16:19 +0100)
committerFrederik Harwath <frederik@codesourcery.com>
Wed, 17 Nov 2021 07:50:55 +0000 (08:50 +0100)
commiteee64041ebd1f801773bbfd4c21b0ab0e4ef8ebe
tree1e60e6154834f86fc885f2b42d49fe59d53da190
parent9ab2a4f699454544b286545c2f540bb99fcd0b93
openacc: Add runtime alias checking for OpenACC kernels

This commit adds the code generation for the runtime alias checks for
OpenACC loops that have been analyzed by Graphite.  The runtime alias
check condition gets generated in Graphite. It is evaluated by the
code generated for the IFN_GOACC_LOOP internal function calls.  If
aliasing is detected at runtime, the execution dimensions get adjusted
to execute the affected loops sequentially.

gcc/ChangeLog:

* graphite-isl-ast-to-gimple.c: Include internal-fn.h.
(graphite_oacc_analyze_scop): Implement runtime alias checks.
* omp-expand.c (expand_oacc_for): Add an additional "noalias" parameter
to GOACC_LOOP internal calls, and initialise it to integer_one_node.
* omp-offload.c (oacc_xform_loop): Integrate the runtime alias check
into the GOACC_LOOP expansion.

libgomp/ChangeLog:

* testsuite/libgomp.oacc-c-c++-common/runtime-alias-check-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/runtime-alias-check-2.c: New test.
gcc/graphite-isl-ast-to-gimple.c
gcc/graphite-scop-detection.c
gcc/omp-expand.c
gcc/omp-offload.c
libgomp/testsuite/libgomp.oacc-c-c++-common/runtime-alias-check-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-c-c++-common/runtime-alias-check-2.c [new file with mode: 0644]