]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Add send_to_remote [PR107635]
authorAndre Vehreschild <vehre@gcc.gnu.org>
Wed, 29 Jan 2025 11:42:18 +0000 (12:42 +0100)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Thu, 20 Feb 2025 09:33:05 +0000 (10:33 +0100)
commit69eb02682b80b84dd0f562f19821c8c8c37ad243
tree5f75429d92cdfb25f7430274faf7e4168cb3e7d5
parent15847252648ede9d2ad9eea398b7b870f62a2b30
Fortran: Add send_to_remote [PR107635]

Refactor to use send_to_remote instead of the slow send_by_ref.

gcc/fortran/ChangeLog:

PR fortran/107635

* coarray.cc (move_coarray_ref): Move the coarray reference out
of the given one.  Especially when there is a regular array ref.
(fixup_comp_refs): Move components refs to a derived type where
the codim has been removed, aka a new type.
(split_expr_at_caf_ref): Correctly split the reference chain.
(remove_caf_ref): Simplify.
(create_get_callback): Fix some deficiencies.
(create_allocated_callback): Adapt to new signature of split.
(create_send_callback): New function.
(rewrite_caf_send): Rewrite a call to caf_send to
caf_send_to_remote.
(coindexed_code_callback): Treat caf_send and caf_sendget
correctly.
* gfortran.h (enum gfc_isym_id): Add SENDGET-isym.
* gfortran.texi: Add documentation for send_to_remote.
* resolve.cc (gfc_resolve_code): No longer generate send_by_ref
when allocatable coarray (component) is on the lhs.
* trans-decl.cc (gfc_build_builtin_function_decls): Add
caf_send_to_remote decl.
* trans-intrinsic.cc (conv_caf_func_index): Ensure the static
variables created are not in a block-scope.
(conv_caf_send_to_remote): Translate caf_send_to_remote calls.
(conv_caf_send): Renamed to conv_caf_sendget.
(conv_caf_sendget): Renamed from conv_caf_send.
(gfc_conv_intrinsic_subroutine): Branch correctly for
conv_caf_send and sendget.
* trans.h: Correct decl.

libgfortran/ChangeLog:

* caf/libcaf.h: Add/Correct prototypes for caf_get_from_remote,
caf_send_to_remote.
* caf/single.c (struct accessor_hash_t): Rename accessor_t to
getter_t.
(_gfortran_caf_register_accessor): Use new name of getter_t.
(_gfortran_caf_send_to_remote): New function for sending data to
coarray on a remote image.

gcc/testsuite/ChangeLog:

* gfortran.dg/coarray/send_char_array_1.f90: Extend test to
catch more cases.
* gfortran.dg/coarray_42.f90: Invert tests use, because no
longer a send is needed when local memory in a coarray is
allocated.
gcc/fortran/coarray.cc
gcc/fortran/gfortran.h
gcc/fortran/gfortran.texi
gcc/fortran/resolve.cc
gcc/fortran/trans-decl.cc
gcc/fortran/trans-intrinsic.cc
gcc/fortran/trans.h
gcc/testsuite/gfortran.dg/coarray/send_char_array_1.f90
gcc/testsuite/gfortran.dg/coarray_42.f90
libgfortran/caf/libcaf.h
libgfortran/caf/single.c