]> git.ipfire.org Git - thirdparty/gcc.git/commit
[nvptx] Handle large vector reductions
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jan 2019 08:11:06 +0000 (08:11 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jan 2019 08:11:06 +0000 (08:11 +0000)
commited42202dbc79959cf07a8ba2d2ca5376c7dbbb11
tree8f4adae4b612be5843852e2f84f0267cd221baec
parent8eb1becfd0faa969dae6c10d480c2bab6c64bfdc
[nvptx] Handle large vector reductions

Add support for vector reductions with openacc vector_length larger than
warp-size.

2019-01-07  Tom de Vries  <tdevries@suse.de>

* config/nvptx/nvptx-protos.h (nvptx_output_red_partition): Declare.
* config/nvptx/nvptx.c (vector_red_size, vector_red_align,
vector_red_partition, vector_red_sym): New global variables.
(nvptx_option_override): Initialize vector_red_sym.
(nvptx_declare_function_name): Restore red_partition register.
(nvptx_file_end): Emit code to declare the vector reduction variables.
(nvptx_output_red_partition): New function.
(nvptx_expand_shared_addr): Add vector argument. Use it to handle
large vector reductions.
(enum nvptx_builtins): Add NVPTX_BUILTIN_VECTOR_ADDR.
(nvptx_init_builtins): Add VECTOR_ADDR.
(nvptx_expand_builtin): Update call to nvptx_expand_shared_addr.
Handle nvptx_expand_shared_addr.
(nvptx_get_shared_red_addr): Add vector argument and handle large
vectors.
(nvptx_goacc_reduction_setup): Add offload_attrs argument and handle
large vectors.
(nvptx_goacc_reduction_init): Likewise.
(nvptx_goacc_reduction_fini): Likewise.
(nvptx_goacc_reduction_teardown): Likewise.
(nvptx_goacc_reduction): Update calls to nvptx_goacc_reduction_{setup,
init,fini,teardown}.
(nvptx_init_axis_predicate): Initialize vector_red_partition.
(nvptx_set_current_function): Init vector_red_partition.
* config/nvptx/nvptx.md (UNSPECV_RED_PART): New unspecv.
(nvptx_red_partition): New insn.
* config/nvptx/nvptx.h (struct machine_function): Add red_partition.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267631 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/nvptx/nvptx-protos.h
gcc/config/nvptx/nvptx.c
gcc/config/nvptx/nvptx.h
gcc/config/nvptx/nvptx.md