[clang] [SPIR-V] Add hlsl_private address space for HLSL/SPIR-V (PR #122103)

Nathan Gauër via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 05:22:49 PST 2025


================
@@ -83,6 +84,7 @@ const LangASMap AMDGPUTargetInfo::AMDGPUDefIsPrivMap = {
     llvm::AMDGPUAS::FLAT_ADDRESS, // ptr32_uptr
     llvm::AMDGPUAS::FLAT_ADDRESS, // ptr64
     llvm::AMDGPUAS::FLAT_ADDRESS, // hlsl_groupshared
+    llvm::AMDGPUAS::FLAT_ADDRESS, // hlsl_private
----------------
Keenuts wrote:

HLSL documentation for those is currently this: https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-variable-syntax

FXC/DXC implementation of a `static int my_global` would be equivalent to a c++ `static thread_local int my_global`. Initialized once, thread local.

If this is not available in AMDGPU yet, what value shall be picked?

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


More information about the cfe-commits mailing list