[OpenMP] Replace device kernel linkage with weak_odr
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 24 Mar 2022 23:32:05 +0000 (19:32 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 25 Mar 2022 15:29:15 +0000 (11:29 -0400)
commitb9f67d44ba37f3012f892a65550ec941f13626c0
tree513c9f7c22edc053e0f0a9a6393cc48804ee50d7
parent5975f1c5f968e07b350d6279f173d68d36a80a50
[OpenMP] Replace device kernel linkage with weak_odr

Currently the device kernels all have weak linkage to prevent linkage
errors on multiple defintions. However, this prevents some optimizations
from adequately analyzing them because of the nature of weak linkage.
This patch replaces the weak linkage with weak_odr linkage so we can
statically assert that multiple declarations of the same kernel will
have the same definition.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D122443
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/test/OpenMP/amdgcn_target_codegen.cpp
clang/test/OpenMP/assumes_include_nvptx.cpp
clang/test/OpenMP/declare_target_codegen.cpp
clang/test/OpenMP/declare_target_link_codegen.cpp
clang/test/OpenMP/metadirective_device_isa_codegen_amdgcn.cpp
clang/test/OpenMP/nvptx_target_firstprivate_codegen.cpp
clang/test/OpenMP/target_firstprivate_codegen.cpp
clang/test/OpenMP/target_private_codegen.cpp
clang/test/OpenMP/target_reduction_codegen.cpp