@@ -63,16 +63,26 @@ var value: Bool { false }
63
63
//////////////////
64
64
65
65
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits24testIntPairWithoutDeinityyF"()
66
- // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
66
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits20IntPairWithoutDeinitV]]
67
+ // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
67
68
//
68
69
// IR: [[BB1]]:
69
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits27consumeIntPairWithoutDeinityyAA0defG0VnF"
70
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 0
71
+ // IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, %TSi* [[GEP]], i32 0, i32 0
72
+ // IR-NEXT: [[LHS:%.*]] = load i64, i64* [[GEP2]]
73
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
74
+ // IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, %TSi* [[GEP]], i32 0, i32 0
75
+ // IR-NEXT: [[RHS:%.*]] = load i64, i64* [[GEP2]]
76
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits27consumeIntPairWithoutDeinityyAA0defG0VnF"(i64 [[LHS]], i64 [[RHS]])
70
77
// IR-NEXT: br label %[[CONT:[0-9]+]]
71
78
//
72
79
// IR: [[BB2]]:
80
+ // IR-NEXT: call [[TYPE]]* @"$s16moveonly_deinits20IntPairWithoutDeinitVWOh"([[TYPE]]* [[ALLOCA]])
73
81
// IR-NEXT: br label %[[CONT]]
74
82
//
75
83
// IR: [[CONT]]:
84
+ // IR-NEXT: bitcast
85
+ // IR-NEXT: @llvm.lifetime.end
76
86
// IR-NEXT: ret void
77
87
// IR-NEXT: }
78
88
public func testIntPairWithoutDeinit( ) {
@@ -83,17 +93,32 @@ public func testIntPairWithoutDeinit() {
83
93
}
84
94
85
95
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits21testIntPairWithDeinityyF"()
96
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits17IntPairWithDeinitV]]
86
97
// IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
87
98
//
88
99
// IR: [[BB1]]:
100
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 0
101
+ // IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, %TSi* [[GEP]], i32 0, i32 0
102
+ // IR-NEXT: [[LHS:%.*]] = load i64, i64* [[GEP2]]
103
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
104
+ // IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, %TSi* [[GEP]], i32 0, i32 0
105
+ // IR-NEXT: [[RHS:%.*]] = load i64, i64* [[GEP2]]
89
106
// IR-NEXT: call swiftcc void @"$s16moveonly_deinits24consumeIntPairWithDeinityyAA0defG0VnF"(
90
107
// IR-NEXT: br label %[[CONT:[0-9]+]]
91
108
//
92
109
// IR: [[BB2]]:
93
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits17IntPairWithDeinitVfD"(
110
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 0
111
+ // IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, %TSi* [[GEP]], i32 0, i32 0
112
+ // IR-NEXT: [[LHS:%.*]] = load i64, i64* [[GEP2]]
113
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
114
+ // IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, %TSi* [[GEP]], i32 0, i32 0
115
+ // IR-NEXT: [[RHS:%.*]] = load i64, i64* [[GEP2]]
116
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits17IntPairWithDeinitVfD"(i64 [[LHS]], i64 [[RHS]])
94
117
// IR-NEXT: br label %[[CONT]]
95
118
//
96
119
// IR: [[CONT]]
120
+ // IR-NEXT: bitcast
121
+ // IR-NEXT: @llvm.lifetime.end
97
122
// IR-NEXT: ret void
98
123
// IR-NEXT: }
99
124
public func testIntPairWithDeinit( ) {
@@ -104,18 +129,24 @@ public func testIntPairWithDeinit() {
104
129
}
105
130
106
131
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits26testKlassPairWithoutDeinityyF"()
107
- // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
132
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits22KlassPairWithoutDeinitV]]
133
+ // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
108
134
//
109
135
// IR: [[BB1]]:
110
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits29consumeKlassPairWithoutDeinityyAA0defG0VnF"
136
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 0
137
+ // IR-NEXT: [[LHS:%.*]] = load [[KLASS:%T16moveonly_deinits5KlassC]]*, [[KLASS]]** [[GEP]]
138
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
139
+ // IR-NEXT: [[RHS:%.*]] = load [[KLASS]]*, [[KLASS]]** [[GEP]]
140
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits29consumeKlassPairWithoutDeinityyAA0defG0VnF"([[KLASS]]* [[LHS]], [[KLASS]]* [[RHS]])
111
141
// IR-NEXT: br label %[[CONT:[0-9]+]]
112
142
//
113
143
// IR: [[BB2]]:
114
- // IR-NEXT: call void bitcast {{.*}} @swift_release
115
- // IR-NEXT: call void bitcast {{.*}} @swift_release
144
+ // IR-NEXT: call [[TYPE]]* @"$s16moveonly_deinits22KlassPairWithoutDeinitVWOh"([[TYPE]]* [[ALLOCA]])
116
145
// IR-NEXT: br label %[[CONT]]
117
146
//
118
147
// IR: [[CONT]]:
148
+ // IR-NEXT: bitcast
149
+ // IR-NEXT: call void
119
150
// IR-NEXT: ret void
120
151
// IR-NEXT: }
121
152
public func testKlassPairWithoutDeinit( ) {
@@ -126,17 +157,28 @@ public func testKlassPairWithoutDeinit() {
126
157
}
127
158
128
159
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits23testKlassPairWithDeinityyF"()
129
- // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
160
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits19KlassPairWithDeinitV]]
161
+ // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
130
162
//
131
163
// IR: [[BB1]]:
132
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits26consumeKlassPairWithDeinityyAA0defG0VnF"(
164
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 0
165
+ // IR-NEXT: [[LHS:%.*]] = load [[KLASS:%T16moveonly_deinits5KlassC]]*, [[KLASS]]** [[GEP]]
166
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
167
+ // IR-NEXT: [[RHS:%.*]] = load [[KLASS]]*, [[KLASS]]** [[GEP]]
168
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits26consumeKlassPairWithDeinityyAA0defG0VnF"([[KLASS]]* [[LHS]], [[KLASS]]* [[RHS]])
133
169
// IR-NEXT: br label %[[CONT:[0-9]+]]
134
170
//
135
171
// IR: [[BB2]]:
136
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits19KlassPairWithDeinitVfD"(
172
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 0
173
+ // IR-NEXT: [[LHS:%.*]] = load [[KLASS:%T16moveonly_deinits5KlassC]]*, [[KLASS]]** [[GEP]]
174
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
175
+ // IR-NEXT: [[RHS:%.*]] = load [[KLASS]]*, [[KLASS]]** [[GEP]]
176
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits19KlassPairWithDeinitVfD"([[KLASS]]* [[LHS]], [[KLASS]]* [[RHS]])
137
177
// IR-NEXT: br label %[[CONT]]
138
178
//
139
179
// IR: [[CONT]]
180
+ // IR-NEXT: bitcast
181
+ // IR-NEXT: @llvm.lifetime.end
140
182
// IR-NEXT: ret void
141
183
// IR-NEXT: }
142
184
public func testKlassPairWithDeinit( ) {
@@ -192,16 +234,25 @@ func consumeKlassEnumPairWithDeinit(_ x: __owned KlassEnumPairWithDeinit) { }
192
234
////////////////
193
235
194
236
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits28testIntEnumPairWithoutDeinityyF"()
195
- // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
237
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits24IntEnumPairWithoutDeinitO]]
238
+ // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
196
239
//
197
240
// IR: [[BB1]]:
198
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits31consumeIntEnumPairWithoutDeinityyAA0defgH0OnF"
241
+ // IR-NEXT: [[CAST:%.*]] = bitcast [[TYPE]]* [[ALLOCA]] to i64*
242
+ // IR-NEXT: [[LHS:%.*]] = load i64, i64* [[CAST]]
243
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
244
+ // IR-NEXT: [[BITCAST:%.*]] = bitcast [1 x i8]* [[GEP]] to i1*
245
+ // IR-NEXT: [[RHS:%.*]] = load i1, i1* [[BITCAST]]
246
+ // IR-NEXT: [[RHS_ZEXT:%.*]] = zext i1 [[RHS]]
247
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits31consumeIntEnumPairWithoutDeinityyAA0defgH0OnF"(i64 [[LHS]], i8 [[RHS_ZEXT]])
199
248
// IR-NEXT: br label %[[CONT:[0-9]+]]
200
249
//
201
250
// IR: [[BB2]]:
202
251
// IR-NEXT: br label %[[CONT]]
203
252
//
204
253
// IR: [[CONT]]:
254
+ // IR-NEXT: bitcast
255
+ // IR-NEXT: call void @llvm.lifetime.end
205
256
// IR-NEXT: ret void
206
257
// IR-NEXT: }
207
258
public func testIntEnumPairWithoutDeinit( ) {
@@ -212,17 +263,32 @@ public func testIntEnumPairWithoutDeinit() {
212
263
}
213
264
214
265
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits25testIntEnumPairWithDeinityyF"()
215
- // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
266
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits21IntEnumPairWithDeinitO]]
267
+ // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
216
268
//
217
269
// IR: [[BB1]]:
218
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits28consumeIntEnumPairWithDeinityyAA0defgH0OnF"(
270
+ // IR-NEXT: [[CAST:%.*]] = bitcast [[TYPE]]* [[ALLOCA]] to i64*
271
+ // IR-NEXT: [[LHS:%.*]] = load i64, i64* [[CAST]]
272
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
273
+ // IR-NEXT: [[BITCAST:%.*]] = bitcast [1 x i8]* [[GEP]] to i1*
274
+ // IR-NEXT: [[RHS:%.*]] = load i1, i1* [[BITCAST]]
275
+ // IR-NEXT: [[RHS_ZEXT:%.*]] = zext i1 [[RHS]]
276
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits28consumeIntEnumPairWithDeinityyAA0defgH0OnF"(i64 [[LHS]], i8 [[RHS_ZEXT]])
219
277
// IR-NEXT: br label %[[CONT:[0-9]+]]
220
278
//
221
279
// IR: [[BB2]]:
222
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits21IntEnumPairWithDeinitOfD"(
280
+ // IR-NEXT: [[CAST:%.*]] = bitcast [[TYPE]]* [[ALLOCA]] to i64*
281
+ // IR-NEXT: [[LHS:%.*]] = load i64, i64* [[CAST]]
282
+ // IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], [[TYPE]]* [[ALLOCA]], i32 0, i32 1
283
+ // IR-NEXT: [[BITCAST:%.*]] = bitcast [1 x i8]* [[GEP]] to i1*
284
+ // IR-NEXT: [[RHS:%.*]] = load i1, i1* [[BITCAST]]
285
+ // IR-NEXT: [[RHS_ZEXT:%.*]] = zext i1 [[RHS]]
286
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits21IntEnumPairWithDeinitOfD"(i64 [[LHS]], i8 [[RHS_ZEXT]])
223
287
// IR-NEXT: br label %[[CONT]]
224
288
//
225
289
// IR: [[CONT]]
290
+ // IR-NEXT: bitcast
291
+ // IR-NEXT: @llvm.lifetime.end
226
292
// IR-NEXT: ret void
227
293
// IR-NEXT: }
228
294
public func testIntEnumPairWithDeinit( ) {
@@ -233,19 +299,22 @@ public func testIntEnumPairWithDeinit() {
233
299
}
234
300
235
301
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits30testKlassEnumPairWithoutDeinityyF"()
236
- // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
302
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits26KlassEnumPairWithoutDeinitO]]
303
+ // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
237
304
//
238
305
// IR: [[BB1]]:
239
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits33consumeKlassEnumPairWithoutDeinityyAA0defgH0OnF"
240
- // IR-NEXT: br label %[[CONT:[0-9]+]]
306
+ // IR-NEXT: [[CAST:%.*]] = bitcast [[TYPE]]* [[ALLOCA]] to i64*
307
+ // IR-NEXT: [[VALUE:%.*]] = load i64, i64* [[CAST]]
308
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits33consumeKlassEnumPairWithoutDeinityyAA0defgH0OnF"(i64 [[VALUE]])
309
+ // IR-NEXT: br label %[[CONT:[0-9]+]]
241
310
//
242
311
// IR: [[BB2]]:
243
- // IR-NEXT: and i64
244
- // IR-NEXT: inttoptr i64
245
- // IR-NEXT: call void{{.*}} @swift_release
312
+ // IR-NEXT: call [[TYPE]]* @"$s16moveonly_deinits26KlassEnumPairWithoutDeinitOWOh"([[TYPE]]* [[ALLOCA]])
246
313
// IR-NEXT: br label %[[CONT]]
247
314
//
248
315
// IR: [[CONT]]:
316
+ // IR-NEXT: bitcast
317
+ // IR-NEXT: @llvm.lifetime.end
249
318
// IR-NEXT: ret void
250
319
// IR-NEXT: }
251
320
public func testKlassEnumPairWithoutDeinit( ) {
@@ -292,17 +361,24 @@ public func testKlassEnumPairWithoutDeinit() {
292
361
// SIL: } // end sil function '$s16moveonly_deinits27testKlassEnumPairWithDeinityyF'
293
362
294
363
// IR-LABEL: define {{.*}}swiftcc void @"$s16moveonly_deinits27testKlassEnumPairWithDeinityyF"()
295
- // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
364
+ // IR: [[ALLOCA:%.*]] = alloca [[TYPE:%T16moveonly_deinits23KlassEnumPairWithDeinitO]]
365
+ // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]]
296
366
//
297
367
// IR: [[BB1]]:
298
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits30consumeKlassEnumPairWithDeinityyAA0defgH0OnF"(
368
+ // IR-NEXT: [[CAST:%.*]] = bitcast [[TYPE]]* [[ALLOCA]] to i64*
369
+ // IR-NEXT: [[LOAD:%.*]] = load i64, i64* [[CAST]]
370
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits30consumeKlassEnumPairWithDeinityyAA0defgH0OnF"(i64 [[LOAD]])
299
371
// IR-NEXT: br label %[[CONT:[0-9]+]]
300
372
//
301
373
// IR: [[BB2]]:
302
- // IR-NEXT: call swiftcc void @"$s16moveonly_deinits23KlassEnumPairWithDeinitOfD"(
374
+ // IR-NEXT: [[CAST:%.*]] = bitcast [[TYPE]]* [[ALLOCA]] to i64*
375
+ // IR-NEXT: [[LOAD:%.*]] = load i64, i64* [[CAST]]
376
+ // IR-NEXT: call swiftcc void @"$s16moveonly_deinits23KlassEnumPairWithDeinitOfD"(i64 [[LOAD]])
303
377
// IR-NEXT: br label %[[CONT]]
304
378
//
305
379
// IR: [[CONT]]
380
+ // IR-NEXT: bitcast
381
+ // IR-NEXT: @llvm.lifetime.end
306
382
// IR-NEXT: ret void
307
383
// IR-NEXT: }
308
384
public func testKlassEnumPairWithDeinit( ) {
0 commit comments