[clang] [Clang][AMDGPU] Permit language address spaces for AMDGPU globals (PR #66205)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 13 06:14:06 PDT 2023


================
@@ -0,0 +1,52 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals --version 3
+// RUN: %clang_cc1 -cc1 -triple amdgcn-amd-amdhsa -emit-llvm %s -o - | FileCheck %s
+
+int [[clang::opencl_global]] a = 1;
+int [[clang::opencl_generic]] b = 2;
+int [[clang::opencl_constant]] c = 3;
+[[clang::loader_uninitialized]] int [[clang::opencl_local]] d;
+[[clang::loader_uninitialized]] int [[clang::opencl_private]] e;
+
+int [[clang::address_space(1)]] x = 1;
+int [[clang::address_space(0)]] y = 2;
+int [[clang::address_space(4)]] z = 3;
----------------
arsenm wrote:

I also meant some values that don't happen to resolve to one of the underlying IR numbers, like 999

https://github.com/llvm/llvm-project/pull/66205


More information about the cfe-commits mailing list