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

Nathan Gauër via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 23 06:51:13 PST 2025


================
@@ -1,7 +1,14 @@
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN:   dxil-pc-shadermodel6.3-library %s \
+// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
 // RUN:   -emit-llvm -disable-llvm-passes -o - | FileCheck %s
 
+// RUN: %clang_cc1 -finclude-default-header -triple spirv-pc-vulkan-library %s \
+// RUN:   -emit-llvm -disable-llvm-passes -o - | FileCheck %s
+
+// CHECK: @a = external addrspace(2) externally_initialized global float, align 4
+// CHECK: @b = external addrspace(2) externally_initialized global double, align 8
+// CHECK: @c = external addrspace(2) externally_initialized global float, align 4
+// CHECK: @d = external addrspace(2) externally_initialized global double, align 8
+
 // CHECK: @[[CB:.+]] = external constant { float, double }
----------------
Keenuts wrote:

Ok, so this `CB` will be replaced by the CBV, and the actual globals will be deleted in favor of the intrinsic if I understand, thanks!

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


More information about the llvm-branch-commits mailing list