@@ -201,7 +201,7 @@ sil [ossa] @dont_copy_let_properties_with_guaranteed_base : $@convention(thin) (
201
201
bb0(%x : @guaranteed $ClassLet):
202
202
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
203
203
204
- %p = ref_element_addr %x : $ClassLet, #ClassLet.aLet
204
+ %p = ref_element_addr [immutable] %x : $ClassLet, #ClassLet.aLet
205
205
%v = load [copy] %p : $*Klass
206
206
%b = begin_borrow %v : $Klass
207
207
apply %f(%b) : $@convention(thin) (@guaranteed Klass) -> ()
@@ -225,7 +225,7 @@ sil [ossa] @dont_copy_let_properties_with_guaranteed_base_and_forwarding_uses :
225
225
bb0(%x : @guaranteed $ClassLet):
226
226
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
227
227
228
- %p = ref_element_addr %x : $ClassLet, #ClassLet.aLet
228
+ %p = ref_element_addr [immutable] %x : $ClassLet, #ClassLet.aLet
229
229
%v = load [copy] %p : $*Klass
230
230
%c = unchecked_ref_cast %v : $Klass to $Klass
231
231
%b = begin_borrow %c : $Klass
@@ -249,30 +249,7 @@ bb0(%x : @guaranteed $SubclassLet):
249
249
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
250
250
251
251
%u = upcast %x : $SubclassLet to $ClassLet
252
- %p = ref_element_addr %u : $ClassLet, #ClassLet.aLet
253
- %v = load [copy] %p : $*Klass
254
- %b = begin_borrow %v : $Klass
255
- apply %f(%b) : $@convention(thin) (@guaranteed Klass) -> ()
256
- end_borrow %b : $Klass
257
- destroy_value %v : $Klass
258
-
259
- return undef : $()
260
- }
261
-
262
- // CHECK-LABEL: sil [ossa] @dont_copy_let_global :
263
- // CHECK: global_addr
264
- // CHECK-NEXT: load_borrow
265
- // CHECK-NEXT: begin_borrow
266
- // CHECK-NEXT: apply
267
- // CHECK-NEXT: end_borrow
268
- // CHECK-NEXT: end_borrow
269
- // CHECK-NEXT: return
270
- // CHECK-NEXT: } // end sil function 'dont_copy_let_global'
271
- sil [ossa] @dont_copy_let_global : $@convention(thin) () -> () {
272
- bb0:
273
- %f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
274
-
275
- %p = global_addr @a_let_global : $*Klass
252
+ %p = ref_element_addr [immutable] %u : $ClassLet, #ClassLet.aLet
276
253
%v = load [copy] %p : $*Klass
277
254
%b = begin_borrow %v : $Klass
278
255
apply %f(%b) : $@convention(thin) (@guaranteed Klass) -> ()
@@ -295,7 +272,7 @@ sil [ossa] @dont_copy_let_properties_with_guaranteed_base_structural : $@convent
295
272
bb0(%x : @guaranteed $ClassLet):
296
273
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
297
274
298
- %p = ref_element_addr %x : $ClassLet, #ClassLet.aLetTuple
275
+ %p = ref_element_addr [immutable] %x : $ClassLet, #ClassLet.aLetTuple
299
276
%q = tuple_element_addr %p : $*(Klass, Klass), 1
300
277
%v = load [copy] %q : $*Klass
301
278
%b = begin_borrow %v : $Klass
@@ -371,7 +348,7 @@ bb0(%x : @owned $ClassLet):
371
348
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
372
349
373
350
%a = begin_borrow %x : $ClassLet
374
- %p = ref_element_addr %a : $ClassLet, #ClassLet.aLet
351
+ %p = ref_element_addr [immutable] %a : $ClassLet, #ClassLet.aLet
375
352
%v = load [copy] %p : $*Klass
376
353
apply %f(%v) : $@convention(thin) (@guaranteed Klass) -> ()
377
354
destroy_value %v : $Klass
@@ -411,7 +388,7 @@ bb0(%x : @owned $ClassLet):
411
388
%f = function_ref @guaranteed_user : $@convention(thin) (@guaranteed Builtin.NativeObject) -> ()
412
389
413
390
%a = begin_borrow %x : $ClassLet
414
- %p = ref_element_addr %a : $ClassLet, #ClassLet.aLet
391
+ %p = ref_element_addr [immutable] %a : $ClassLet, #ClassLet.aLet
415
392
%v = load [copy] %p : $*Klass
416
393
%v_cast = unchecked_ref_cast %v : $Klass to $Builtin.NativeObject
417
394
apply %f(%v_cast) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> ()
@@ -1147,7 +1124,7 @@ bb0(%0 : @guaranteed $FakeOptional<ClassLet>):
1147
1124
switch_enum %0 : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1148
1125
1149
1126
bb1(%1 : @guaranteed $ClassLet):
1150
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1127
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1151
1128
%3 = load [copy] %2 : $*Klass
1152
1129
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1153
1130
destroy_value %3 : $Klass
@@ -1173,7 +1150,7 @@ bb0(%0 : @owned $FakeOptional<ClassLet>):
1173
1150
switch_enum %0a : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1174
1151
1175
1152
bb1(%1 : @guaranteed $ClassLet):
1176
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1153
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1177
1154
%3 = load [copy] %2 : $*Klass
1178
1155
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1179
1156
destroy_value %3 : $Klass
@@ -1203,7 +1180,7 @@ bb0(%0 : $*FakeOptional<ClassLet>):
1203
1180
switch_enum %0a : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1204
1181
1205
1182
bb1(%1 : @guaranteed $ClassLet):
1206
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1183
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1207
1184
%3 = load [copy] %2 : $*Klass
1208
1185
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1209
1186
destroy_value %3 : $Klass
@@ -1242,7 +1219,7 @@ bb0c(%0c : @guaranteed $FakeOptional<ClassLet>):
1242
1219
switch_enum %0d : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1243
1220
1244
1221
bb1(%1 : @guaranteed $ClassLet):
1245
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1222
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1246
1223
%3 = load [copy] %2 : $*Klass
1247
1224
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1248
1225
destroy_value %3 : $Klass
@@ -1278,7 +1255,7 @@ bb1:
1278
1255
bb2:
1279
1256
%0b = begin_borrow %0 : $FakeOptional<ClassLet>
1280
1257
%0b2 = unchecked_enum_data %0b : $FakeOptional<ClassLet>, #FakeOptional.some!enumelt
1281
- %2 = ref_element_addr %0b2 : $ClassLet, #ClassLet.aLet
1258
+ %2 = ref_element_addr [immutable] %0b2 : $ClassLet, #ClassLet.aLet
1282
1259
%3 = load [copy] %2 : $*Klass
1283
1260
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1284
1261
destroy_value %3 : $Klass
@@ -1522,12 +1499,9 @@ bbEnd:
1522
1499
return %9999 : $()
1523
1500
}
1524
1501
1525
- // Just make sure that we do not crash on this code and convert the 2nd load
1526
- // [copy] to a load_borrow.
1502
+ // Just make sure that we do not crash on this code
1527
1503
//
1528
1504
// CHECK-LABEL: sil [ossa] @improper_dead_end_block_crasher_test : $@convention(thin) (Builtin.RawPointer) -> () {
1529
- // CHECK: load_borrow
1530
- // CHECK: load_borrow
1531
1505
// CHECK: } // end sil function 'improper_dead_end_block_crasher_test'
1532
1506
sil [ossa] @improper_dead_end_block_crasher_test : $@convention(thin) (Builtin.RawPointer) -> () {
1533
1507
bb0(%0 : $Builtin.RawPointer):
0 commit comments