diff options
author | Julian Brown <julian@codesourcery.com> | 2023-03-22 22:57:33 +0000 |
---|---|---|
committer | Julian Brown <julian@codesourcery.com> | 2023-03-27 18:52:27 +0000 |
commit | abcb5dbac666513c798e574808f849f76a1c0799 (patch) | |
tree | e4362107823263261afa2cf4984b2524f9654736 /gcc/tree-ssa-loop-split.cc | |
parent | 09f39bb11413d05c4cd87991bf223e1c006c3707 (diff) | |
download | gcc-abcb5dbac666513c798e574808f849f76a1c0799.zip gcc-abcb5dbac666513c798e574808f849f76a1c0799.tar.gz gcc-abcb5dbac666513c798e574808f849f76a1c0799.tar.bz2 |
[og12] OpenMP: Constructors and destructors for "declare target" static aggregates
This patch adds support for running constructors and destructors for
static (file-scope) aggregates for C++ objects which are marked with
"declare target" directives on OpenMP offload targets.
At present, space is allocated on the target for such aggregates, but
nothing ever constructs them properly, so they end up zero-initialised.
Tested with offloading to AMD GCN. I will apply to the og12 branch
shortly.
ChangeLog
2023-03-27 Julian Brown <julian@codesourcery.com>
gcc/cp/
* decl2.cc (priority_info): Add omp_tgt_initializations_p and
omp_tgt_destructions_p.
(start_objects, start_static_storage_duration_function,
do_static_initialization_or_destruction,
one_static_initialization_or_destruction,
generate_ctor_or_dtor_function): Add 'omp_target' parameter. Support
"declare target" decls. Update forward declarations.
(OMP_SSDF_IDENTIFIER): New macro.
(omp_tgt_ssdf_decls): New vec.
(get_priority_info): Initialize omp_tgt_initializations_p and
omp_tgt_destructions_p fields.
(handle_tls_init): Update call to
omp_static_initialization_or_destruction.
(c_parse_final_cleanups): Support constructors/destructors on OpenMP
offload targets.
gcc/
* omp-builtins.def (BUILT_IN_OMP_IS_INITIAL_DEVICE): New builtin.
* tree.cc (get_file_function_name): Support names for on-target
constructor/destructor functions.
libgomp/
* testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C: New
test.
* testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C: New
test.
Diffstat (limited to 'gcc/tree-ssa-loop-split.cc')
0 files changed, 0 insertions, 0 deletions