gcc/libgomp/testsuite
Tom de Vries e0451f93d9 [nvptx] Add some support for .local atomics
The ptx insn atom doesn't support local memory.  In case of doing an atomic
operation on local memory, we run into:
...
operation not supported on global/shared address space
...
This is the cuGetErrorString message for CUDA_ERROR_INVALID_ADDRESS_SPACE.

The message is somewhat confusing given that actually the operation is not
supported on local address space.

Fix this by falling back on a non-atomic version when detecting
a frame-related memory operand.

This only solves some cases that are detected at compile-time.  It does
however fix the openacc private-atomic-* test-cases.

Tested on x86_64 with nvptx accelerator.

gcc/ChangeLog:

2022-01-27  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/nvptx.md (define_insn "atomic_compare_and_swap<mode>_1")
	(define_insn "atomic_exchange<mode>")
	(define_insn "atomic_fetch_add<mode>")
	(define_insn "atomic_fetch_addsf")
	(define_insn "atomic_fetch_<logic><mode>"): Output non-atomic version
	if memory operands is frame-relative.

gcc/testsuite/ChangeLog:

2022-01-31  Tom de Vries  <tdevries@suse.de>

	* gcc.target/nvptx/stack-atomics-run.c: New test.

libgomp/ChangeLog:

2022-01-27  Tom de Vries  <tdevries@suse.de>

	* testsuite/libgomp.oacc-c-c++-common/private-atomic-1.c: Remove
	PR83812 workaround.
	* testsuite/libgomp.oacc-fortran/private-atomic-1-vector.f90: Same.
	* testsuite/libgomp.oacc-fortran/private-atomic-1-worker.f90: Same.
2022-02-01 19:28:24 +01:00
..
config Update copyright years. 2022-01-03 10:42:10 +01:00
lib Improve Intel MIC offloading XFAILing for 'omp_get_device_num' 2022-01-13 13:09:36 +01:00
libgomp.c Host and offload targets have no common meaning of address spaces 2022-01-13 11:16:20 +01:00
libgomp.c++ openmp: Fix libgomp.c++ testsuite errors for non-offload configs 2021-12-10 00:39:03 +08:00
libgomp.c-c++-common Improve Intel MIC offloading XFAILing for 'omp_get_device_num' 2022-01-13 13:09:36 +01:00
libgomp.fortran [libgomp, testsuite] Reduce recursion depth in declare_target-*.f90 2022-02-01 08:13:06 +01:00
libgomp.graphite Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp.oacc-c [testsuite] Unset 'offload_target' after use 2020-07-24 14:00:43 +02:00
libgomp.oacc-c++ nvptx: update fix for -Wformat-diag 2022-01-19 08:27:00 +01:00
libgomp.oacc-c-c++-common [nvptx] Add some support for .local atomics 2022-02-01 19:28:24 +01:00
libgomp.oacc-fortran [nvptx] Add some support for .local atomics 2022-02-01 19:28:24 +01:00
Makefile.am libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
Makefile.in libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
libgomp-site-extra.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
libgomp-test-support.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00