[llvm-branch-commits] [clang] [llvm] [HLSL] Add resource constructor with implicit binding for global resources (PR #138976)
Ashley Coleman via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon May 12 15:49:58 PDT 2025
================
@@ -55,11 +55,33 @@ export void foo() {
// CHECK-SAME: i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3)
// CHECK-NEXT: ret void
-// Buf2 initialization part 1 - FIXME: constructor with implicit binding does not exist yet;
-// the global init function currently calls the default RWByteAddressBuffer C1 constructor
-// CHECK: define internal void @__cxx_global_var_init.1()
+// Buf2 initialization part 1 - global init function that calls RWByteAddressBuffer C1 constructor with implicit binding
+// CHECK: define internal void @__cxx_global_var_init.1() #0 {
// CHECK-NEXT: entry:
-// CHECK-NEXT: call void @_ZN4hlsl19RWByteAddressBufferC1Ev(ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf2)
+// CHECK-NEXT: call void @_ZN4hlsl19RWByteAddressBufferC1Ejijj(ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf2,
+// CHECK-SAME: i32 noundef 0, i32 noundef 1, i32 noundef 0, i32 noundef 0)
+
+// Buf2 initialization part 2 - body of RWByteAddressBuffer C1 constructor with implicit binding that calls the C2 constructor
+// CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC1Ejijj(ptr noundef nonnull align 4 dereferenceable(4) %this,
+// CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %order_id)
+// CHECK-NEXT: entry:
+// CHECK-NEXT: %this.addr = alloca ptr, align 4
----------------
V-FEXrt wrote:
Is this test too fragile? In other tests we don't actually want to verify all the `alloca`/`load`s since they aren't actually doing the work we care about and will get optimized away. Is that the case here too?
https://github.com/llvm/llvm-project/pull/138976
More information about the llvm-branch-commits
mailing list