[Openmp-commits] [PATCH] D129896: [Libomptarget] Fix warnings on address space attributes

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 15 12:36:24 PDT 2022

jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, tianshilei1992.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

The device runtime uses the address space attribute to control the
placement of important constants on the GPU. The changes made in D126061 <https://reviews.llvm.org/D126061>
caused these to start emitting errors as they were not applied to the
type. This patch fixes the issues to make the warnings go away.

  rG LLVM Github Monorepo



Index: openmp/libomptarget/DeviceRTL/include/Types.h
--- openmp/libomptarget/DeviceRTL/include/Types.h
+++ openmp/libomptarget/DeviceRTL/include/Types.h
@@ -202,12 +202,12 @@
 // TODO: clang should use address space 5 for omp_thread_mem_alloc, but right
 //       now that's not the case.
 #define THREAD_LOCAL(NAME)                                                     \
-  NAME [[clang::loader_uninitialized, clang::address_space(5)]]
+  [[clang::address_space(5)]] NAME [[clang::loader_uninitialized]]
 // TODO: clang should use address space 4 for omp_const_mem_alloc, maybe it
 //       does?
 #define CONSTANT(NAME)                                                         \
-  NAME [[clang::loader_uninitialized, clang::address_space(4)]]
+  [[clang::address_space(4)]] NAME [[clang::loader_uninitialized]]
 // Attribute to keep alive certain definition for the bitcode library.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129896.445104.patch
Type: text/x-patch
Size: 987 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220715/62852600/attachment.bin>

More information about the Openmp-commits mailing list