]> git.ipfire.org Git - thirdparty/gcc.git/commit
amdgcn: Change offload variable table discovery
authorAndrew Stubbs <ams@codesourcery.com>
Tue, 16 Nov 2021 10:32:35 +0000 (10:32 +0000)
committerAndrew Stubbs <ams@codesourcery.com>
Wed, 22 Dec 2021 11:49:56 +0000 (11:49 +0000)
commit028b55a93e16015543f3a6cabda2e9b043bd3028
treed85a32bf185ebca5d60ec99a2c3920f3f97f04e0
parent4da9ae405b0b6c6b08bb0d0605da0a96c02babb7
amdgcn: Change offload variable table discovery

Up to now the libgomp GCN plugin has been finding the offload variables
by using a symbol lookup, but the AMD runtime requires that the symbols are
global for that to work. This was ensured by mkoffload as a post-procssing
step, but the LLVM 13 assembler no longer accepts this in the case where the
variable was previously declared differently.

This patch switches to locating the symbols directly from the
offload_var_table, which means that only one symbol needs to be forced
global.

This changes breaks the libgomp image compatibility so GOMP_VERSION_GCN has
also been bumped.

gcc/ChangeLog:

* config/gcn/mkoffload.c (process_asm): Process the variable table
completely differently.
(process_obj): Encode the varaible data differently.

include/ChangeLog:

* gomp-constants.h (GOMP_VERSION_GCN): Bump.

libgomp/ChangeLog:

* plugin/plugin-gcn.c (struct gcn_image_desc): Remove global_variables.
(GOMP_OFFLOAD_load_image): Locate the offload variables via the
table, not individual symbols.

(cherry picked from commit 4a87a8e4b13e979e7c8a626a8f4082715a48e21e)
gcc/ChangeLog.omp
gcc/config/gcn/mkoffload.c
include/ChangeLog.omp
include/gomp-constants.h
libgomp/ChangeLog.omp
libgomp/plugin/plugin-gcn.c