@@ -35,25 +35,8 @@ export void foo() {
35
35
// Buf1 initialization part 2 - body of RWBuffer<float> C1 constructor with explicit binding that calls the C2 constructor
36
36
// CHECK: define linkonce_odr void @_ZN4hlsl8RWBufferIfEC1Ejjij(ptr noundef nonnull align 4 dereferenceable(4) %this,
37
37
// CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index)
38
- // CHECK-NEXT: entry:
39
- // CHECK-NEXT: %this.addr = alloca ptr, align 4
40
- // CHECK-NEXT: %registerNo.addr = alloca i32, align 4
41
- // CHECK-NEXT: %spaceNo.addr = alloca i32, align 4
42
- // CHECK-NEXT: %range.addr = alloca i32, align 4
43
- // CHECK-NEXT: %index.addr = alloca i32, align 4
44
- // CHECK-NEXT: store ptr %this, ptr %this.addr, align 4
45
- // CHECK-NEXT: store i32 %registerNo, ptr %registerNo.addr, align 4
46
- // CHECK-NEXT: store i32 %spaceNo, ptr %spaceNo.addr, align 4
47
- // CHECK-NEXT: store i32 %range, ptr %range.addr, align 4
48
- // CHECK-NEXT: store i32 %index, ptr %index.addr, align 4
49
- // CHECK-NEXT: %this1 = load ptr, ptr %this.addr, align 4
50
- // CHECK-NEXT: %0 = load i32, ptr %registerNo.addr, align 4
51
- // CHECK-NEXT: %1 = load i32, ptr %spaceNo.addr, align 4
52
- // CHECK-NEXT: %2 = load i32, ptr %range.addr, align 4
53
- // CHECK-NEXT: %3 = load i32, ptr %index.addr, align 4
54
- // CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC2Ejjij(ptr noundef nonnull align 4 dereferenceable(4) %this1,
55
- // CHECK-SAME: i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3)
56
- // CHECK-NEXT: ret void
38
+ // CHECK: call void @_ZN4hlsl8RWBufferIfEC2Ejjij(ptr noundef nonnull align 4 dereferenceable(4)
39
+ // CHECK-SAME: %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}}, i32 noundef %{{.*}})
57
40
58
41
// Buf2 initialization part 1 - FIXME: constructor with implicit binding does not exist yet;
59
42
// the global init function currently calls the default RWBufer<double> C1 constructor
@@ -69,48 +52,22 @@ export void foo() {
69
52
70
53
// Buf3 initialization part 2 - body of RWBuffer<int> default C1 constructor that calls the default C2 constructor
71
54
// CHECK: define linkonce_odr void @_ZN4hlsl8RWBufferIiEC1Ev(ptr noundef nonnull align 4 dereferenceable(4) %this)
72
- // CHECK-NEXT: entry:
73
- // CHECK-NEXT: %this.addr = alloca ptr, align 4
74
- // CHECK-NEXT: store ptr %this, ptr %this.addr, align 4
75
- // CHECK-NEXT: %this1 = load ptr, ptr %this.addr, align 4
76
- // CHECK-NEXT: call void @_ZN4hlsl8RWBufferIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %this1)
77
- // CHECK-NEXT: ret void
55
+ // CHECK: call void @_ZN4hlsl8RWBufferIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %{{.*}})
78
56
79
57
// Buf1 initialization part 3 - body of RWBuffer<float> C2 constructor with explicit binding that initializes
80
58
// handle with @llvm.dx.resource.handlefrombinding
81
59
// CHECK: define linkonce_odr void @_ZN4hlsl8RWBufferIfEC2Ejjij(ptr noundef nonnull align 4 dereferenceable(4) %this,
82
60
// CHECK-SAME: i32 noundef %registerNo, i32 noundef %spaceNo, i32 noundef %range, i32 noundef %index)
83
- // CHECK-NEXT: entry:
84
- // CHECK-NEXT: %this.addr = alloca ptr, align 4
85
- // CHECK-NEXT: %registerNo.addr = alloca i32, align 4
86
- // CHECK-NEXT: %spaceNo.addr = alloca i32, align 4
87
- // CHECK-NEXT: %range.addr = alloca i32, align 4
88
- // CHECK-NEXT: %index.addr = alloca i32, align 4
89
- // CHECK-NEXT: store ptr %this, ptr %this.addr, align 4
90
- // CHECK-NEXT: store i32 %registerNo, ptr %registerNo.addr, align 4
91
- // CHECK-NEXT: store i32 %spaceNo, ptr %spaceNo.addr, align 4
92
- // CHECK-NEXT: store i32 %range, ptr %range.addr, align 4
93
- // CHECK-NEXT: store i32 %index, ptr %index.addr, align 4
94
- // CHECK-NEXT: %this1 = load ptr, ptr %this.addr, align 4
95
- // CHECK-NEXT: %0 = load i32, ptr %registerNo.addr, align 4
96
- // CHECK-NEXT: %1 = load i32, ptr %spaceNo.addr, align 4
97
- // CHECK-NEXT: %2 = load i32, ptr %range.addr, align 4
98
- // CHECK-NEXT: %3 = load i32, ptr %index.addr, align 4
99
- // CHECK-DXIL-NEXT: %4 = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0_0t(
100
- // CHECK-DXIL-SAME: i32 %1, i32 %0, i32 %2, i32 %3, i1 false)
101
- // CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::RWBuffer", ptr %this1, i32 0, i32 0
102
- // CHECK-DXIL-NEXT: store target("dx.TypedBuffer", float, 1, 0, 0) %4, ptr %__handle, align 4
61
+ // CHECK-DXIL: %[[HANDLE:.*]] = call target("dx.TypedBuffer", float, 1, 0, 0) @llvm.dx.resource.handlefrombinding.tdx.TypedBuffer_f32_1_0_0t(
62
+ // CHECK-DXIL-SAME: i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false)
63
+ // CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::RWBuffer", ptr %{{.*}}, i32 0, i32 0
64
+ // CHECK-DXIL-NEXT: store target("dx.TypedBuffer", float, 1, 0, 0) %[[HANDLE]], ptr %__handle, align 4
103
65
// CHECK-NEXT: ret void
104
66
105
67
// Buf3 initialization part 3 - body of RWBuffer<int> default C2 constructor that initializes handle to poison
106
68
// CHECK: define linkonce_odr void @_ZN4hlsl8RWBufferIiEC2Ev(ptr noundef nonnull align 4 dereferenceable(4) %this)
107
- // CHECK-NEXT: entry:
108
- // CHECK-NEXT: %this.addr = alloca ptr, align 4
109
- // CHECK-NEXT: store ptr %this, ptr %this.addr, align 4
110
- // CHECK-NEXT: %this1 = load ptr, ptr %this.addr, align 4
111
- // CHECK-NEXT: %__handle = getelementptr inbounds nuw %"class.hlsl::RWBuffer.1", ptr %this1, i32 0, i32 0
69
+ // CHECK: %__handle = getelementptr inbounds nuw %"class.hlsl::RWBuffer.1", ptr %{{.*}}, i32 0, i32 0
112
70
// CHECK-NEXT: store target("dx.TypedBuffer", i32, 1, 0, 1) poison, ptr %__handle, align 4
113
- // CHECK-NEXT: ret void
114
71
115
72
// Module initialization
116
73
// CHECK: define internal void @_GLOBAL__sub_I_RWBuffer_constructor.hlsl()
0 commit comments