@@ -24,30 +24,33 @@ export void foo() {
24
24
// CHECK: %"class.hlsl::RasterizerOrderedByteAddressBuffer" = type { target("dx.RawBuffer", i8, 1, 1) }
25
25
26
26
// CHECK: @_ZL4Buf1 = internal global %"class.hlsl::ByteAddressBuffer" poison, align 4
27
+ // CHECK: @[[Buf1Str:.*]] = private unnamed_addr constant [5 x i8] c"Buf1\00", align 1
27
28
// CHECK: @_ZL4Buf2 = internal global %"class.hlsl::RWByteAddressBuffer" poison, align 4
29
+ // CHECK: @[[Buf2Str:.*]] = private unnamed_addr constant [5 x i8] c"Buf2\00", align 1
28
30
29
31
// Buf1 initialization part 1 - global init function that calls ByteAddressBuffer C1 constructor with explicit binding
30
32
// CHECK: define internal void @__cxx_global_var_init()
31
33
// CHECK-NEXT: entry:
32
- // CHECK-NEXT: call void @_ZN4hlsl17ByteAddressBufferC1Ejjij (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf1,
33
- // CHECK-SAME: i32 noundef 1, i32 noundef 2, i32 noundef 1, i32 noundef 0)
34
+ // CHECK-NEXT: call void @_ZN4hlsl17ByteAddressBufferC1EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf1,
35
+ // CHECK-SAME: i32 noundef 1, i32 noundef 2, i32 noundef 1, i32 noundef 0, ptr noundef @[[Buf1Str]] )
34
36
35
37
// Buf1 initialization part 2 - body of ByteAddressBuffer C1 constructor with explicit binding that calls the C2 constructor
36
- // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC1Ejjij (ptr noundef nonnull align 4 dereferenceable(4) %this,
37
- // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index)
38
- // CHECK: call void @_ZN4hlsl17ByteAddressBufferC2Ejjij (ptr noundef nonnull align 4 dereferenceable(4)
39
- // CHECK-SAME: %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}})
38
+ // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC1EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4) %this,
39
+ // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, ptr noundef %name )
40
+ // CHECK: call void @_ZN4hlsl17ByteAddressBufferC2EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4)
41
+ // CHECK-SAME: %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, ptr noundef %{{.*}} )
40
42
41
43
// Buf2 initialization part 1 - global init function that calls RWByteAddressBuffer C1 constructor with implicit binding
42
- // CHECK: define internal void @__cxx_global_var_init.1() #0 {
44
+ // CHECK: define internal void @__cxx_global_var_init.1()
43
45
// CHECK-NEXT: entry:
44
- // CHECK-NEXT: call void @_ZN4hlsl19RWByteAddressBufferC1Ejijj (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf2,
45
- // CHECK-SAME: i32 noundef 0, i32 noundef 1, i32 noundef 0, i32 noundef 0)
46
+ // CHECK-NEXT: call void @_ZN4hlsl19RWByteAddressBufferC1EjijjPKc (ptr noundef nonnull align 4 dereferenceable(4) @_ZL4Buf2,
47
+ // CHECK-SAME: i32 noundef 0, i32 noundef 1, i32 noundef 0, i32 noundef 0, ptr noundef @[[Buf2Str]] )
46
48
47
49
// Buf2 initialization part 2 - body of RWByteAddressBuffer C1 constructor with implicit binding that calls the C2 constructor
48
- // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC1Ejijj(ptr noundef nonnull align 4 dereferenceable(4) %this,
49
- // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId)
50
- // CHECK: call void @_ZN4hlsl19RWByteAddressBufferC2Ejijj(ptr noundef nonnull align 4 dereferenceable(4) %this1, i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4
50
+ // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC1EjijjPKc(ptr noundef nonnull align 4 dereferenceable(4) %this,
51
+ // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId, ptr noundef %name)
52
+ // CHECK: call void @_ZN4hlsl19RWByteAddressBufferC2EjijjPKc(ptr noundef nonnull align 4 dereferenceable(4) %this1,
53
+ // CHECK-SAME: i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, ptr noundef %{{.*}})
51
54
52
55
// Buf3 initialization part 1 - local variable declared in function foo() is initialized by
53
56
// RasterizerOrderedByteAddressBuffer C1 default constructor
@@ -64,18 +67,19 @@ export void foo() {
64
67
65
68
// Buf1 initialization part 3 - ByteAddressBuffer C2 constructor with explicit binding that initializes
66
69
// handle with @llvm.dx.resource.handlefrombinding
67
- // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC2Ejjij (ptr noundef nonnull align 4 dereferenceable(4) %this,
68
- // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index)
70
+ // CHECK: define linkonce_odr void @_ZN4hlsl17ByteAddressBufferC2EjjijPKc (ptr noundef nonnull align 4 dereferenceable(4) %this,
71
+ // CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, ptr noundef %name )
69
72
// CHECK-DXIL: %[[HANDLE:.*]] = call target("dx.RawBuffer", i8, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.RawBuffer_i8_0_0t(
70
73
// CHECK-DXIL-SAME: i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false)
71
74
// CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::ByteAddressBuffer", ptr %{{.*}}, i32 0, i32 0
72
75
// CHECK-DXIL-NEXT: store target("dx.RawBuffer", i8, 0, 0) %[[HANDLE]], ptr %__handle, align 4
73
76
74
77
// Buf2 initialization part 3 - body of RWByteAddressBuffer C2 constructor with implicit binding that initializes
75
78
// handle with @llvm.dx.resource.handlefromimplicitbinding
76
- // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC2Ejijj(ptr noundef nonnull align 4 dereferenceable(4) %this,
77
- // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId) unnamed_addr #1 align 2 {
78
- // CHECK: %[[HANDLE:.*]] = call target("dx.RawBuffer", i8, 1, 0) @llvm.dx.resource.handlefromimplicitbinding.tdx.RawBuffer_i8_1_0t(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false)
79
+ // CHECK: define linkonce_odr void @_ZN4hlsl19RWByteAddressBufferC2EjijjPKc(ptr noundef nonnull align 4 dereferenceable(4) %this,
80
+ // CHECK-SAME: i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index, i32 noundef %orderId, ptr noundef %name)
81
+ // CHECK: %[[HANDLE:.*]] = call target("dx.RawBuffer", i8, 1, 0) @llvm.dx.resource.handlefromimplicitbinding.tdx.RawBuffer_i8_1_0t
82
+ // CHECK-SAME: (i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false)
79
83
// CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::RWByteAddressBuffer", ptr %this1, i32 0, i32 0
80
84
// CHECK-NEXT: store target("dx.RawBuffer", i8, 1, 0) %[[HANDLE]], ptr %__handle, align 4
81
85
0 commit comments