@@ -8,7 +8,7 @@ import Builtin
8
8
9
9
// -- Generic structs with fixed layout should have no completion function
10
10
// and emit the field offset vector as part of the pattern.
11
- // CHECK: [[PATTERN:@.*]] = internal constant [3 x i64 ] [i64 0, i64 1, i64 8 ]
11
+ // CHECK: [[PATTERN:@.*]] = internal constant [4 x i32 ] [i32 0, i32 1, i32 8, i32 0 ]
12
12
// CHECK-LABEL: @"$S15generic_structs18FixedLayoutGenericVMP" = internal constant <{ {{.*}} }> <{
13
13
// -- instantiation function
14
14
// CHECK-SAME: %swift.type* (%swift.type_descriptor*, i8**, i8**)* @"$S15generic_structs18FixedLayoutGenericVMi"
@@ -19,9 +19,9 @@ import Builtin
19
19
// -- vwtable pointer
20
20
// CHECK-SAME: @"$S15generic_structs18FixedLayoutGenericVWV"
21
21
// -- extra data pattern
22
- // CHECK-SAME: [3 x i64 ]* [[PATTERN]]
22
+ // CHECK-SAME: [4 x i32 ]* [[PATTERN]]
23
23
// CHECK-SAME: i16 1,
24
- // CHECK-SAME: i16 3 }>
24
+ // CHECK-SAME: i16 2 }>
25
25
26
26
// -- Generic structs with dynamic layout contain the vwtable pattern as part
27
27
// of the metadata pattern, and no independent vwtable symbol
@@ -95,14 +95,14 @@ import Builtin
95
95
// CHECK: @"$S15generic_structs23DynamicWithRequirementsVMP" = internal constant <{ {{.*}} }> <{
96
96
97
97
// -- Fixed-layout struct metadata contains fixed field offsets
98
- // CHECK: @"$S15generic_structs6IntishVMf" = internal constant <{ {{.*}} i64 }> <{
99
- // CHECK-SAME: i64 0
98
+ // CHECK: @"$S15generic_structs6IntishVMf" = internal constant <{ {{.*}} i32, [4 x i8] }> <{
99
+ // CHECK-SAME: i32 0
100
100
// CHECK-SAME: }>
101
- // CHECK: @"$S15generic_structs7CharethVMf" = internal constant <{ {{.*}} i64 }> <{
102
- // CHECK-SAME: i64 0
101
+ // CHECK: @"$S15generic_structs7CharethVMf" = internal constant <{ {{.*}} i32, [4 x i8] }> <{
102
+ // CHECK-SAME: i32 0
103
103
// CHECK-SAME: }>
104
- // CHECK: @"$S15generic_structs8StringlyVMf" = internal constant <{ {{.*}} i64, i64, i64 }> <{
105
- // CHECK-SAME: i64 0, i64 8, i64 16
104
+ // CHECK: @"$S15generic_structs8StringlyVMf" = internal constant <{ {{.*}} i32, i32, i32, [4 x i8] }> <{
105
+ // CHECK-SAME: i32 0, i32 8, i32 16, [4 x i8] zeroinitializer
106
106
// CHECK-SAME: }>
107
107
108
108
struct FixedLayoutGeneric<T> {
@@ -160,31 +160,31 @@ sil @explode_complex_dynamic : $<A, B> (@in ComplexDynamic<A, B>, @inout Byteful
160
160
entry(%0 : $*ComplexDynamic<A, B>, %1 : $*Byteful, %2 : $*A, %3 : $*B, %4 : $*Chareth):
161
161
%a = struct_element_addr %0 : $*ComplexDynamic<A, B>, #ComplexDynamic.a2
162
162
163
- // CHECK: [[METADATA:%.*]] = bitcast %swift.type* {{%.*}} to i64 *
164
- // CHECK: [[FIELD_OFFSET_VECTOR:%.*]] = getelementptr inbounds i64, i64 * [[METADATA]], i64 4
165
- // CHECK: [[FIELD_OFFSET_ADDR:%.*]] = getelementptr inbounds i64, i64 * [[FIELD_OFFSET_VECTOR]], i32 2
166
- // CHECK: [[FIELD_OFFSET:%.*]] = load i64, i64 * [[FIELD_OFFSET_ADDR]], align 8
163
+ // CHECK: [[METADATA:%.*]] = bitcast %swift.type* {{%.*}} to i32 *
164
+ // CHECK: [[FIELD_OFFSET_VECTOR:%.*]] = getelementptr inbounds i32, i32 * [[METADATA]], i64 8
165
+ // CHECK: [[FIELD_OFFSET_ADDR:%.*]] = getelementptr inbounds i32, i32 * [[FIELD_OFFSET_VECTOR]], i32 2
166
+ // CHECK: [[FIELD_OFFSET:%.*]] = load i32, i32 * [[FIELD_OFFSET_ADDR]], align 8
167
167
// CHECK: [[BYTES:%.*]] = bitcast %T15generic_structs14ComplexDynamicV* %0 to i8*
168
- // CHECK: [[BYTE_OFFSET:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[FIELD_OFFSET]]
168
+ // CHECK: [[BYTE_OFFSET:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i32 [[FIELD_OFFSET]]
169
169
// CHECK: bitcast i8* [[BYTE_OFFSET]] to %swift.opaque*
170
170
%b = struct_element_addr %0 : $*ComplexDynamic<A, B>, #ComplexDynamic.b
171
171
172
- // CHECK: [[METADATA:%.*]] = bitcast %swift.type* {{%.*}} to i64 *
173
- // CHECK: [[FIELD_OFFSET_VECTOR:%.*]] = getelementptr inbounds i64, i64 * [[METADATA]], i64 4
174
- // CHECK: [[FIELD_OFFSET_ADDR:%.*]] = getelementptr inbounds i64, i64 * [[FIELD_OFFSET_VECTOR]], i32 3
175
- // CHECK: [[FIELD_OFFSET:%.*]] = load i64, i64 * [[FIELD_OFFSET_ADDR]], align 8
172
+ // CHECK: [[METADATA:%.*]] = bitcast %swift.type* {{%.*}} to i32 *
173
+ // CHECK: [[FIELD_OFFSET_VECTOR:%.*]] = getelementptr inbounds i32, i32 * [[METADATA]], i64 8
174
+ // CHECK: [[FIELD_OFFSET_ADDR:%.*]] = getelementptr inbounds i32, i32 * [[FIELD_OFFSET_VECTOR]], i32 3
175
+ // CHECK: [[FIELD_OFFSET:%.*]] = load i32, i32 * [[FIELD_OFFSET_ADDR]], align 8
176
176
// CHECK: [[BYTES:%.*]] = bitcast %T15generic_structs14ComplexDynamicV* %0 to i8*
177
- // CHECK: [[BYTE_OFFSET:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[FIELD_OFFSET]]
177
+ // CHECK: [[BYTE_OFFSET:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i32 [[FIELD_OFFSET]]
178
178
// CHECK: bitcast i8* [[BYTE_OFFSET]] to %T15generic_structs13SingleDynamicV
179
179
%5 = struct_element_addr %0 : $*ComplexDynamic<A, B>, #ComplexDynamic.c
180
180
%c = struct_element_addr %5 : $*SingleDynamic<B>, #SingleDynamic.x
181
181
182
- // CHECK: [[METADATA:%.*]] = bitcast %swift.type* {{%.*}} to i64 *
183
- // CHECK: [[FIELD_OFFSET_VECTOR:%.*]] = getelementptr inbounds i64, i64 * [[METADATA]], i64 4
184
- // CHECK: [[FIELD_OFFSET_ADDR:%.*]] = getelementptr inbounds i64, i64 * [[FIELD_OFFSET_VECTOR]], i32 4
185
- // CHECK: [[FIELD_OFFSET:%.*]] = load i64, i64 * [[FIELD_OFFSET_ADDR]], align 8
182
+ // CHECK: [[METADATA:%.*]] = bitcast %swift.type* {{%.*}} to i32 *
183
+ // CHECK: [[FIELD_OFFSET_VECTOR:%.*]] = getelementptr inbounds i32, i32 * [[METADATA]], i64 8
184
+ // CHECK: [[FIELD_OFFSET_ADDR:%.*]] = getelementptr inbounds i32, i32 * [[FIELD_OFFSET_VECTOR]], i32 4
185
+ // CHECK: [[FIELD_OFFSET:%.*]] = load i32, i32 * [[FIELD_OFFSET_ADDR]], align 8
186
186
// CHECK: [[BYTES:%.*]] = bitcast %T15generic_structs14ComplexDynamicV* %0 to i8*
187
- // CHECK: [[BYTE_OFFSET:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[FIELD_OFFSET]]
187
+ // CHECK: [[BYTE_OFFSET:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i32 [[FIELD_OFFSET]]
188
188
// CHECK: bitcast i8* [[BYTE_OFFSET]] to %T15generic_structs7CharethV
189
189
%d = struct_element_addr %0 : $*ComplexDynamic<A, B>, #ComplexDynamic.d
190
190
copy_addr %a to %1 : $*Byteful
@@ -205,10 +205,10 @@ entry(%0 : $*ComplexDynamic<A, B>, %1 : $*Byteful, %2 : $*A, %3 : $*B, %4 : $*Ch
205
205
// CHECK-LABEL: define{{( protected)?}} internal swiftcc %swift.metadata_response @"$S15generic_structs13SingleDynamicVMr"
206
206
// CHECK-SAME: (%swift.type* [[METADATA:%.*]], i8*, i8**) {{.*}} {
207
207
// Lay out fields.
208
- // CHECK: [[T0:%.*]] = bitcast %swift.type* [[METADATA]] to i64 *
209
- // CHECK: [[T1:%.*]] = getelementptr inbounds i64, i64 * [[T0]], i64 3
208
+ // CHECK: [[T0:%.*]] = bitcast %swift.type* [[METADATA]] to i32 *
209
+ // CHECK: [[T1:%.*]] = getelementptr inbounds i32, i32 * [[T0]], i64 6
210
210
// CHECK: [[T2:%.*]] = getelementptr inbounds i8**, i8*** [[TYPES:%.*]], i32 0
211
- // CHECK: call void @swift_initStructMetadata(%swift.type* [[METADATA]], i64 0, i64 1, i8*** [[TYPES]], i64 * [[T1]])
211
+ // CHECK: call void @swift_initStructMetadata(%swift.type* [[METADATA]], i64 0, i64 1, i8*** [[TYPES]], i32 * [[T1]])
212
212
// CHECK: ret %swift.metadata_response
213
213
// CHECK: }
214
214
0 commit comments