[Openmp-commits] [openmp] cdea437 - [Libomptarget] Fix warnings on address space attributes

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 15 14:21:40 PDT 2022


Author: Joseph Huber
Date: 2022-07-15T17:21:30-04:00
New Revision: cdea4370572151207452ad6e8ee36b3eac654d55

URL: https://github.com/llvm/llvm-project/commit/cdea4370572151207452ad6e8ee36b3eac654d55
DIFF: https://github.com/llvm/llvm-project/commit/cdea4370572151207452ad6e8ee36b3eac654d55.diff

LOG: [Libomptarget] Fix warnings on address space attributes

The device runtime uses the address space attribute to control the
placement of important constants on the GPU. The changes made in 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.

Reviewed By: ye-luo

Differential Revision: https://reviews.llvm.org/D129896

Added: 
    

Modified: 
    openmp/libomptarget/DeviceRTL/include/Types.h

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/DeviceRTL/include/Types.h b/openmp/libomptarget/DeviceRTL/include/Types.h
index fcb75e31c455e..54a9ee197e3b6 100644
--- a/openmp/libomptarget/DeviceRTL/include/Types.h
+++ b/openmp/libomptarget/DeviceRTL/include/Types.h
@@ -202,12 +202,12 @@ enum OMPTgtExecModeFlags : int8_t {
 // 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.
 #ifdef LIBOMPTARGET_BC_TARGET


        


More information about the Openmp-commits mailing list