72
72
; CHECK-RT: call half @_Z20__spirv_SpecConstantiDh(i32 [[#SCID0:]], half 0xH4000)
73
73
74
74
%call.i3 = tail call i32 @_Z37__sycl_getScalar2020SpecConstantValueIiET_PKcPvS3_ (i8* getelementptr inbounds ([34 x i8 ], [34 x i8 ]* @__builtin_unique_stable_name._Z27get_specialization_constantIL_Z6id_intE17specialization_idIiEiET1_v , i64 0 , i64 0 ), i8* bitcast (%class.specialization_id.0* @id_int to i8* ), i8* null )
75
- ; CHECK-DEF: %[[GEP1:[0-9a-z]+]] = getelementptr i8, i8* null, i32 2
75
+ ; CHECK-DEF: %[[GEP1:[0-9a-z]+]] = getelementptr i8, i8* null, i32 4
76
76
; CHECK-DEF: %[[BITCAST1:[0-9a-z]+]] = bitcast i8* %[[GEP1]] to i32*
77
77
; CHECK-DEF: %[[LOAD1:[0-9a-z]+]] = load i32, i32* %[[BITCAST1]], align 4
78
78
;
96
96
%0 = bitcast %struct.ComposConst* %tmp to i8*
97
97
call void @llvm.lifetime.start.p0i8 (i64 24 , i8* nonnull %0 ) #3
98
98
call void @_Z40__sycl_getComposite2020SpecConstantValueI11ComposConstET_PKcPvS4_ (%struct.ComposConst* nonnull sret (%struct.ComposConst ) align 8 %tmp , i8* getelementptr inbounds ([37 x i8 ], [37 x i8 ]* @__builtin_unique_stable_name._Z27get_specialization_constantIL_Z9id_composE17specialization_idI11ComposConstES1_ET1_v , i64 0 , i64 0 ), i8* bitcast (%class.specialization_id.1* @id_compos to i8* ), i8* null )
99
- ; CHECK-DEF: %[[GEP:[0-9a-z]+]] = getelementptr i8, i8* null, i32 6
99
+ ; CHECK-DEF: %[[GEP:[0-9a-z]+]] = getelementptr i8, i8* null, i32 8
100
100
; CHECK-DEF: %[[BITCAST:[0-9a-z]+]] = bitcast i8* %[[GEP]] to %struct.ComposConst*
101
101
; CHECK-DEF: %[[C1:[0-9a-z]+]] = load %struct.ComposConst, %struct.ComposConst* %[[BITCAST]], align 8
102
102
;
@@ -113,7 +113,7 @@ entry:
113
113
%1 = getelementptr inbounds %struct.ComposConst2 , %struct.ComposConst2* %tmp1 , i64 0 , i32 0
114
114
call void @llvm.lifetime.start.p0i8 (i64 24 , i8* nonnull %1 ) #3
115
115
call void @_Z40__sycl_getComposite2020SpecConstantValueI12ComposConst2ET_PKcPvS4_ (%struct.ComposConst2* nonnull sret (%struct.ComposConst2 ) align 8 %tmp1 , i8* getelementptr inbounds ([39 x i8 ], [39 x i8 ]* @__builtin_unique_stable_name._Z27get_specialization_constantIL_Z10id_compos2E17specialization_idI12ComposConst2ES1_ET1_v , i64 0 , i64 0 ), i8* getelementptr inbounds (%class.specialization_id.2 , %class.specialization_id.2* @id_compos2 , i64 0 , i32 0 , i32 0 ), i8* null ) call void @llvm.lifetime.end.p0i8 (i64 24 , i8* nonnull %1 ) #3
116
- ; CHECK-DEF: %[[GEP1:[0-9a-z]+]] = getelementptr i8, i8* null, i32 30
116
+ ; CHECK-DEF: %[[GEP1:[0-9a-z]+]] = getelementptr i8, i8* null, i32 32
117
117
; CHECK-DEF: %[[BITCAST1:[0-9a-z]+]] = bitcast i8* %[[GEP1]] to %struct.ComposConst2*
118
118
; CHECK-DEF: %[[C2:[0-9a-z]+]] = load %struct.ComposConst2, %struct.ComposConst2* %[[BITCAST1]], align 8
119
119
;
@@ -129,7 +129,7 @@ entry:
129
129
%2 = bitcast %struct.ComposConst* %tmp2 to i8*
130
130
call void @llvm.lifetime.start.p0i8 (i64 24 , i8* nonnull %2 ) #3
131
131
call void @_Z40__sycl_getComposite2020SpecConstantValueI11ComposConstET_PKcPvS4_ (%struct.ComposConst* nonnull sret (%struct.ComposConst ) align 8 %tmp2 , i8* getelementptr inbounds ([37 x i8 ], [37 x i8 ]* @__builtin_unique_stable_name._Z27get_specialization_constantIL_Z9id_composE17specialization_idI11ComposConstES1_ET1_v , i64 0 , i64 0 ), i8* bitcast (%class.specialization_id.1* @id_compos to i8* ), i8* null )
132
- ; CHECK-DEF: %[[GEP2:[0-9a-z]+]] = getelementptr i8, i8* null, i32 6
132
+ ; CHECK-DEF: %[[GEP2:[0-9a-z]+]] = getelementptr i8, i8* null, i32 8
133
133
; CHECK-DEF: %[[BITCAST2:[0-9a-z]+]] = bitcast i8* %[[GEP2]] to %struct.ComposConst*
134
134
; CHECK-DEF: %[[C3:[0-9a-z]+]] = load %struct.ComposConst, %struct.ComposConst* %[[BITCAST2]], align 8
135
135
;
@@ -148,7 +148,7 @@ entry:
148
148
define void @test_zeroinit () {
149
149
%tmp = alloca %struct.ComposConst3 , align 4
150
150
%1 = bitcast %struct.ComposConst3* %tmp to i8*
151
- ; CHECK-DEF: %[[GEP3:[0-9a-z]+]] = getelementptr i8, i8* null, i32 54
151
+ ; CHECK-DEF: %[[GEP3:[0-9a-z]+]] = getelementptr i8, i8* null, i32 56
152
152
; CHECK-DEF: %[[BITCAST3:[0-9a-z]+]] = bitcast i8* %[[GEP3]] to %struct.ComposConst3*
153
153
; CHECK-DEF: %[[C3:[0-9a-z]+]] = load %struct.ComposConst3, %struct.ComposConst3* %[[BITCAST3]], align 4
154
154
;
@@ -169,7 +169,7 @@ define void @test3() {
169
169
%tmp3 = alloca %struct.MArrayConst3 , align 8
170
170
%tmp4 = alloca %struct.MArrayConst4 , align 8
171
171
%1 = bitcast %struct.VectorConst* %tmp to i8*
172
- ; CHECK-DEF: %[[GEP1:[0-9a-z]+]] = getelementptr i8, i8* null, i32 70
172
+ ; CHECK-DEF: %[[GEP1:[0-9a-z]+]] = getelementptr i8, i8* null, i32 72
173
173
; CHECK-DEF: %[[BITCAST1:[0-9a-z]+]] = bitcast i8* %[[GEP1]] to %struct.VectorConst*
174
174
; CHECK-DEF: %[[C1:[0-9a-z]+]] = load %struct.VectorConst, %struct.VectorConst* %[[BITCAST1]], align 8
175
175
;
@@ -179,7 +179,7 @@ define void @test3() {
179
179
; CHECK-RT: call %struct.VectorConst @_Z29__spirv_SpecConstantCompositeDv2_i_Rstruct.VectorConst(<2 x i32> %[[#CE1]])
180
180
call void @_Z40__sycl_getComposite2020SpecConstantValueI11VectorConstET_PKcPvS4_ (%struct.VectorConst* nonnull sret (%struct.VectorConst ) align 8 %tmp , i8* getelementptr inbounds ([38 x i8 ], [38 x i8 ]* @__builtin_unique_stable_name._Z27get_specialization_constantIL_Z10id_vectorE17specialization_idI11VectorConstES1_ET1_v , i64 0 , i64 0 ), i8* bitcast (%class.specialization_id.3* @id_vector to i8* ), i8* null )
181
181
%2 = bitcast %struct.MArrayConst* %tmp1 to i8*
182
- ; CHECK-DEF: %[[GEP2:[0-9a-z]+]] = getelementptr i8, i8* null, i32 78
182
+ ; CHECK-DEF: %[[GEP2:[0-9a-z]+]] = getelementptr i8, i8* null, i32 80
183
183
; CHECK-DEF: %[[BITCAST2:[0-9a-z]+]] = bitcast i8* %[[GEP2]] to %struct.MArrayConst*
184
184
; CHECK-DEF: %[[C2:[0-9a-z]+]] = load %struct.MArrayConst, %struct.MArrayConst* %[[BITCAST2]], align 4
185
185
;
@@ -234,11 +234,14 @@ attributes #3 = { nounwind }
234
234
235
235
; CHECK: !sycl.specialization-constants = !{![[#ID0:]], ![[#ID1:]], ![[#ID2:]], ![[#ID3:]], ![[#ID_COMPOS3:]], ![[#ID4:]], ![[#ID5:]]
236
236
;
237
- ; CHECK-DEF: !sycl.specialization-constants-default-values = !{![[#ID4:]], ![[#ID5:]], ![[#ID6:]], ![[#ID7:]], ![[#ID_COMPOS3_DEFAULT:]], ![[#ID8:]], ![[#ID9:]]
237
+ ; CHECK-DEF: !sycl.specialization-constants-default-values = !{![[#ID4:]], ![[#ID5_PAD:]], ![[# ID5:]], ![[#ID6:]], ![[#ID7:]], ![[#ID_COMPOS3_DEFAULT:]], ![[#ID8:]], ![[#ID9:]]
238
238
; CHECK-RT: !sycl.specialization-constants-default-values
239
239
;
240
- ; CHECK: ![[#ID0]] = !{!"_ZTS14name_generatorIL_Z9id_halfEE", i32 0, i32 0, i32 2}
241
- ; CHECK: ![[#ID1]] = !{!"_ZTS14name_generatorIL_Z6id_intEE", i32 1, i32 0, i32 4}
240
+ ; Emulated spec constant may use an extra padding element to ensure alignment
241
+ ; CHECK-RT: ![[#ID0]] = !{!"_ZTS14name_generatorIL_Z9id_halfEE", i32 0, i32 0, i32 2}
242
+ ; CHECK-DEF: ![[#ID0]] = !{!"_ZTS14name_generatorIL_Z9id_halfEE", i32 0, i32 0, i32 2, i32 -1, i32 2, i32 2}
243
+ ;
244
+ ; CHECK: ![[#ID1]] = !{!"_ZTS14name_generatorIL_Z6id_intEE", i32 1, i32 0, i32 4}
242
245
;
243
246
; For composite types, the amount of metadata is a bit different between native and emulated spec constants
244
247
;
@@ -256,6 +259,7 @@ attributes #3 = { nounwind }
256
259
; CHECK-RT-SAME: i32 [[#SCID9]], i32 16, i32 8}
257
260
;
258
261
; CHECK-DEF: ![[#ID4]] = !{half 0xH4000}
262
+ ; CHECK-DEF: ![[#ID5_PAD]] = !{[2 x i8] zeroinitializer}
259
263
; CHECK-DEF: ![[#ID5]] = !{i32 42}
260
264
; CHECK-DEF: ![[#ID6]] = !{%struct.ComposConst { i32 1, double 2.000000e+00, %struct.myConst { i32 13, float 0x4020666660000000 } }}
261
265
; CHECK-DEF: ![[#ID7]] = !{%struct.ComposConst2 { i8 1, %struct.myConst { i32 52, float 0x40479999A0000000 }, double 2.000000e+00 }}
0 commit comments