Skip to content

Commit b0fbddd

Browse files
committed
[OpenMP] Only put retain for NVPTX so it can be optimized out for AMD
Summary: This is a hack that only NVPTX needs.
1 parent 7f2fb80 commit b0fbddd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

offload/DeviceRTL/src/Misc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,12 @@ void *indirectCallLookup(void *HstPtr) {
115115
/// The openmp client instance used to communicate with the server.
116116
/// FIXME: This is marked as 'retain' so that it is not removed via
117117
/// `-mlink-builtin-bitcode`
118+
#ifdef __NVPTX__
118119
[[gnu::visibility("protected"), gnu::weak,
119120
gnu::retain]] rpc::Client Client asm("__llvm_rpc_client");
121+
#else
122+
[[gnu::visibility("protected"), gnu::weak]] rpc::Client Client asm("__llvm_rpc_client");
123+
#endif
120124

121125
} // namespace impl
122126
} // namespace ompx

0 commit comments

Comments
 (0)