[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

Tex Riddell via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jan 17 16:14:05 PST 2025


================
@@ -83,6 +83,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_constant
----------------
tex3d wrote:

Note: I noticed this uses `LangASMap`, but doesn't specify a value for `wasm_funcref`, which will invisibly initialize it to `0` (initializer shorter than array type `LangASMap`) and that maps to the dummy value of `FLAT_ADDRESS` likely desired anyway.  It doesn't rely on this auto-initialization for sycl_global and beyond though, even though it could.

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


More information about the llvm-branch-commits mailing list