gcc/libgomp
Andrew Stubbs f6fff8a6fc amdgcn, libgomp: Manually allocated stacks
Switch from using stacks in the "private segment" to using a memory block
allocated on the host side.  The primary reason is to permit the reverse
offload implementation to access values located on the device stack, but
there may also be performance benefits, especially with repeated kernel
invocations.

This implementation unifies the stacks with the "team arena" optimization
feature, and now allows both to have run-time configurable sizes.

A new ABI is needed, so all libraries must be rebuilt, and newlib must be
version 4.3.0.20230120 or newer.

gcc/ChangeLog:

	* config/gcn/gcn-run.cc: Include libgomp-gcn.h.
	(struct kernargs): Replace the common content with kernargs_abi.
	(struct heap): Delete.
	(main): Read GCN_STACK_SIZE envvar.
	Allocate space for the device stacks.
	Write the new kernargs fields.
	* config/gcn/gcn.cc (gcn_option_override): Remove stack_size_opt.
	(default_requested_args): Remove PRIVATE_SEGMENT_BUFFER_ARG and
	PRIVATE_SEGMENT_WAVE_OFFSET_ARG.
	(gcn_addr_space_convert): Mask the QUEUE_PTR_ARG content.
	(gcn_expand_prologue): Move the TARGET_PACKED_WORK_ITEMS to the top.
	Set up the stacks from the values in the kernargs, not private.
	(gcn_expand_builtin_1): Match the stack configuration in the prologue.
	(gcn_hsa_declare_function_name): Turn off the private segment.
	(gcn_conditional_register_usage): Ensure QUEUE_PTR is fixed.
	* config/gcn/gcn.h (FIXED_REGISTERS): Fix the QUEUE_PTR register.
	* config/gcn/gcn.opt (mstack-size): Change the description.

include/ChangeLog:

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

libgomp/ChangeLog:

	* config/gcn/libgomp-gcn.h (DEFAULT_GCN_STACK_SIZE): New define.
	(DEFAULT_TEAM_ARENA_SIZE): New define.
	(struct heap): Move to this file.
	(struct kernargs_abi): Likewise.
	* config/gcn/team.c (gomp_gcn_enter_kernel): Use team arena size from
	the kernargs.
	* libgomp.h: Include libgomp-gcn.h.
	(TEAM_ARENA_SIZE): Remove.
	(team_malloc): Update the error message.
	* plugin/plugin-gcn.c (struct kernargs): Move common content to
	struct kernargs_abi.
	(struct agent_info): Rename team arenas to ephemeral memories.
	(struct team_arena_list): Rename ....
	(struct ephemeral_memories_list): to this.
	(struct heap): Delete.
	(team_arena_size): New variable.
	(stack_size): New variable.
	(print_kernel_dispatch): Update debug messages.
	(init_environment_variables): Read GCN_TEAM_ARENA_SIZE.
	Read GCN_STACK_SIZE.
	(get_team_arena): Rename ...
	(configure_ephemeral_memories): ... to this, and set up stacks.
	(release_team_arena): Rename ...
	(release_ephemeral_memories): ... to this.
	(destroy_team_arenas): Rename ...
	(destroy_ephemeral_memories): ... to this.
	(create_kernel_dispatch): Add num_threads parameter.
	Adjust for kernargs_abi refactor and ephemeral memories.
	(release_kernel_dispatch): Adjust for ephemeral memories.
	(run_kernel): Pass thread-count to create_kernel_dispatch.
	(GOMP_OFFLOAD_init_device): Adjust for ephemeral memories.
	(GOMP_OFFLOAD_fini_device): Adjust for ephemeral memories.

gcc/testsuite/ChangeLog:

	* gcc.c-torture/execute/pr47237.c: Xfail on amdgcn.
	* gcc.dg/builtin-apply3.c: Xfail for amdgcn.
	* gcc.dg/builtin-apply4.c: Xfail for amdgcn.
	* gcc.dg/torture/stackalign/builtin-apply-3.c: Xfail for amdgcn.
	* gcc.dg/torture/stackalign/builtin-apply-4.c: Xfail for amdgcn.
2023-02-02 11:47:03 +00:00
..
config amdgcn, libgomp: Manually allocated stacks 2023-02-02 11:47:03 +00:00
plugin amdgcn, libgomp: Manually allocated stacks 2023-02-02 11:47:03 +00:00
testsuite Fortran: Extend align-clause checks of OpenMP's allocate directive 2023-02-01 14:51:00 +01:00
.gitattributes libgomp: Fixes + cleanup for OpenACC's Fortran module + openacc_lib.h 2020-02-19 09:13:44 +01:00
acc_prof.h Update copyright years. 2023-01-16 11:52:17 +01:00
acinclude.m4 libgomp: fix typo in mold linker detection 2022-06-28 10:35:32 +02:00
aclocal.m4 libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
affinity-fmt.c Update copyright years. 2023-01-16 11:52:17 +01:00
affinity.c Update copyright years. 2023-01-16 11:52:17 +01:00
alloc.c Update copyright years. 2023-01-16 11:52:17 +01:00
allocator.c Update copyright years. 2023-01-16 11:52:17 +01:00
atomic.c Update copyright years. 2023-01-16 11:52:17 +01:00
barrier.c Update copyright years. 2023-01-16 11:52:17 +01:00
ChangeLog Daily bump. 2023-02-02 00:17:43 +00:00
ChangeLog.graphite
config.h.in Refactor '-ldl' handling for libgomp proper and plugins 2022-05-12 15:11:30 +02:00
configure Regenerate Makefile.in files. 2023-01-17 12:20:05 +01:00
configure.ac Revert "sphinx: add --with-sphinx-build" 2022-11-14 09:35:05 +01:00
configure.tgt LoongArch Port: libgomp 2022-03-29 17:43:35 +08:00
critical.c Update copyright years. 2023-01-16 11:52:17 +01:00
env.c Update copyright years. 2023-01-16 11:52:17 +01:00
error.c Update copyright years. 2023-01-16 11:52:17 +01:00
fortran.c Update copyright years. 2023-01-16 11:52:17 +01:00
hashtab.h Update copyright years. 2023-01-16 11:52:17 +01:00
icv-device.c Update copyright years. 2023-01-16 11:52:17 +01:00
icv.c Update copyright years. 2023-01-16 11:52:17 +01:00
iter_ull.c Update copyright years. 2023-01-16 11:52:17 +01:00
iter.c Update copyright years. 2023-01-16 11:52:17 +01:00
libgomp_f.h.in Update copyright years. 2023-01-16 11:52:17 +01:00
libgomp_g.h Update copyright years. 2023-01-16 11:52:17 +01:00
libgomp-plugin.c Update copyright years. 2023-01-16 11:52:17 +01:00
libgomp-plugin.h Update copyright years. 2023-01-16 11:52:17 +01:00
libgomp.h amdgcn, libgomp: Manually allocated stacks 2023-02-02 11:47:03 +00:00
libgomp.map libgomp/nvptx: Prepare for reverse-offload callback handling 2022-10-24 17:04:08 +02:00
libgomp.spec.in
libgomp.texi libgomp.texi (OpenMP TR11 impl. status): Fix 'strict' item 2023-02-02 12:05:58 +01:00
lock.c Update copyright years. 2023-01-16 11:52:17 +01:00
loop_ull.c Update copyright years. 2023-01-16 11:52:17 +01:00
loop.c Update copyright years. 2023-01-16 11:52:17 +01:00
Makefile.am Refactor '-ldl' handling for libgomp proper and plugins 2022-05-12 15:11:30 +02:00
Makefile.in Regenerate Makefile.in files. 2023-01-17 12:20:05 +01:00
oacc-async.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-cuda.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-host.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-init.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-int.h Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-mem.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-parallel.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-plugin.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-plugin.h Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-profiling.c Update copyright years. 2023-01-16 11:52:17 +01:00
oacc-target.c GCN libgomp port 2019-11-13 12:38:04 +00:00
omp_lib.f90.in Update copyright years. 2023-01-16 11:52:17 +01:00
omp_lib.h.in Update copyright years. 2023-01-16 11:52:17 +01:00
omp.h.in Update copyright years. 2023-01-16 11:52:17 +01:00
openacc_lib.h Update copyright years. 2023-01-16 11:52:17 +01:00
openacc.f90 Update copyright years. 2023-01-16 11:52:17 +01:00
openacc.h Update copyright years. 2023-01-16 11:52:17 +01:00
ordered.c Update copyright years. 2023-01-16 11:52:17 +01:00
parallel.c Update copyright years. 2023-01-16 11:52:17 +01:00
priority_queue.c Update copyright years. 2023-01-16 11:52:17 +01:00
priority_queue.h Update copyright years. 2023-01-16 11:52:17 +01:00
scope.c Update copyright years. 2023-01-16 11:52:17 +01:00
sections.c Update copyright years. 2023-01-16 11:52:17 +01:00
secure_getenv.h Update copyright years. 2023-01-16 11:52:17 +01:00
single.c Update copyright years. 2023-01-16 11:52:17 +01:00
splay-tree.c Update copyright years. 2023-01-16 11:52:17 +01:00
splay-tree.h Update copyright years. 2023-01-16 11:52:17 +01:00
target.c Update copyright years. 2023-01-16 11:52:17 +01:00
task.c Update copyright years. 2023-01-16 11:52:17 +01:00
taskloop.c Update copyright years. 2023-01-16 11:52:17 +01:00
team.c Update copyright years. 2023-01-16 11:52:17 +01:00
teams.c Update copyright years. 2023-01-16 11:52:17 +01:00
work.c Update copyright years. 2023-01-16 11:52:17 +01:00