]> git.ipfire.org Git - thirdparty/gcc.git/commit - libgomp/plugin/plugin-gcn.c
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>
Fri, 10 Dec 2021 10:45:09 +0000 (10:45 +0000)
commit4a87a8e4b13e979e7c8a626a8f4082715a48e21e
tree2f91529327ffcb7d066bcef4e4da203af311d13f
parenta5f65cf7ad640ae398eba7a45c712322ce841809
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.
gcc/config/gcn/mkoffload.c
include/gomp-constants.h
libgomp/plugin/plugin-gcn.c