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

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 13 06:03:23 PDT 2023


================
@@ -0,0 +1,31 @@
+// 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 = 0;
+int [[clang::opencl_generic]] b = 0;
+int [[clang::opencl_constant]] c = 0;
+[[clang::loader_uninitialized]] int [[clang::opencl_local]] d;
+[[clang::loader_uninitialized]] int [[clang::opencl_private]] e;
+
----------------
jhuber6 wrote:

As in, assigning the variables to some random value that's non-zero, or numerical address space attributes.

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


More information about the cfe-commits mailing list