@@ -199,7 +199,7 @@ sil [ossa] @dont_copy_let_properties_with_guaranteed_base : $@convention(thin) (
199
199
bb0(%x : @guaranteed $ClassLet):
200
200
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
201
201
202
- %p = ref_element_addr %x : $ClassLet, #ClassLet.aLet
202
+ %p = ref_element_addr [immutable] %x : $ClassLet, #ClassLet.aLet
203
203
%v = load [copy] %p : $*Klass
204
204
%b = begin_borrow %v : $Klass
205
205
apply %f(%b) : $@convention(thin) (@guaranteed Klass) -> ()
@@ -223,7 +223,7 @@ sil [ossa] @dont_copy_let_properties_with_guaranteed_base_and_forwarding_uses :
223
223
bb0(%x : @guaranteed $ClassLet):
224
224
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
225
225
226
- %p = ref_element_addr %x : $ClassLet, #ClassLet.aLet
226
+ %p = ref_element_addr [immutable] %x : $ClassLet, #ClassLet.aLet
227
227
%v = load [copy] %p : $*Klass
228
228
%c = unchecked_ref_cast %v : $Klass to $Klass
229
229
%b = begin_borrow %c : $Klass
@@ -247,30 +247,7 @@ bb0(%x : @guaranteed $SubclassLet):
247
247
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
248
248
249
249
%u = upcast %x : $SubclassLet to $ClassLet
250
- %p = ref_element_addr %u : $ClassLet, #ClassLet.aLet
251
- %v = load [copy] %p : $*Klass
252
- %b = begin_borrow %v : $Klass
253
- apply %f(%b) : $@convention(thin) (@guaranteed Klass) -> ()
254
- end_borrow %b : $Klass
255
- destroy_value %v : $Klass
256
-
257
- return undef : $()
258
- }
259
-
260
- // CHECK-LABEL: sil [ossa] @dont_copy_let_global :
261
- // CHECK: global_addr
262
- // CHECK-NEXT: load_borrow
263
- // CHECK-NEXT: begin_borrow
264
- // CHECK-NEXT: apply
265
- // CHECK-NEXT: end_borrow
266
- // CHECK-NEXT: end_borrow
267
- // CHECK-NEXT: return
268
- // CHECK-NEXT: } // end sil function 'dont_copy_let_global'
269
- sil [ossa] @dont_copy_let_global : $@convention(thin) () -> () {
270
- bb0:
271
- %f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
272
-
273
- %p = global_addr @a_let_global : $*Klass
250
+ %p = ref_element_addr [immutable] %u : $ClassLet, #ClassLet.aLet
274
251
%v = load [copy] %p : $*Klass
275
252
%b = begin_borrow %v : $Klass
276
253
apply %f(%b) : $@convention(thin) (@guaranteed Klass) -> ()
@@ -293,7 +270,7 @@ sil [ossa] @dont_copy_let_properties_with_guaranteed_base_structural : $@convent
293
270
bb0(%x : @guaranteed $ClassLet):
294
271
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
295
272
296
- %p = ref_element_addr %x : $ClassLet, #ClassLet.aLetTuple
273
+ %p = ref_element_addr [immutable] %x : $ClassLet, #ClassLet.aLetTuple
297
274
%q = tuple_element_addr %p : $*(Klass, Klass), 1
298
275
%v = load [copy] %q : $*Klass
299
276
%b = begin_borrow %v : $Klass
@@ -369,7 +346,7 @@ bb0(%x : @owned $ClassLet):
369
346
%f = function_ref @black_hole : $@convention(thin) (@guaranteed Klass) -> ()
370
347
371
348
%a = begin_borrow %x : $ClassLet
372
- %p = ref_element_addr %a : $ClassLet, #ClassLet.aLet
349
+ %p = ref_element_addr [immutable] %a : $ClassLet, #ClassLet.aLet
373
350
%v = load [copy] %p : $*Klass
374
351
apply %f(%v) : $@convention(thin) (@guaranteed Klass) -> ()
375
352
destroy_value %v : $Klass
@@ -409,7 +386,7 @@ bb0(%x : @owned $ClassLet):
409
386
%f = function_ref @guaranteed_user : $@convention(thin) (@guaranteed Builtin.NativeObject) -> ()
410
387
411
388
%a = begin_borrow %x : $ClassLet
412
- %p = ref_element_addr %a : $ClassLet, #ClassLet.aLet
389
+ %p = ref_element_addr [immutable] %a : $ClassLet, #ClassLet.aLet
413
390
%v = load [copy] %p : $*Klass
414
391
%v_cast = unchecked_ref_cast %v : $Klass to $Builtin.NativeObject
415
392
apply %f(%v_cast) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> ()
@@ -1145,7 +1122,7 @@ bb0(%0 : @guaranteed $FakeOptional<ClassLet>):
1145
1122
switch_enum %0 : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1146
1123
1147
1124
bb1(%1 : @guaranteed $ClassLet):
1148
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1125
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1149
1126
%3 = load [copy] %2 : $*Klass
1150
1127
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1151
1128
destroy_value %3 : $Klass
@@ -1171,7 +1148,7 @@ bb0(%0 : @owned $FakeOptional<ClassLet>):
1171
1148
switch_enum %0a : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1172
1149
1173
1150
bb1(%1 : @guaranteed $ClassLet):
1174
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1151
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1175
1152
%3 = load [copy] %2 : $*Klass
1176
1153
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1177
1154
destroy_value %3 : $Klass
@@ -1201,7 +1178,7 @@ bb0(%0 : $*FakeOptional<ClassLet>):
1201
1178
switch_enum %0a : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1202
1179
1203
1180
bb1(%1 : @guaranteed $ClassLet):
1204
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1181
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1205
1182
%3 = load [copy] %2 : $*Klass
1206
1183
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1207
1184
destroy_value %3 : $Klass
@@ -1240,7 +1217,7 @@ bb0c(%0c : @guaranteed $FakeOptional<ClassLet>):
1240
1217
switch_enum %0d : $FakeOptional<ClassLet>, case #FakeOptional.some!enumelt: bb1, case #FakeOptional.none!enumelt: bb2
1241
1218
1242
1219
bb1(%1 : @guaranteed $ClassLet):
1243
- %2 = ref_element_addr %1 : $ClassLet, #ClassLet.aLet
1220
+ %2 = ref_element_addr [immutable] %1 : $ClassLet, #ClassLet.aLet
1244
1221
%3 = load [copy] %2 : $*Klass
1245
1222
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1246
1223
destroy_value %3 : $Klass
@@ -1276,7 +1253,7 @@ bb1:
1276
1253
bb2:
1277
1254
%0b = begin_borrow %0 : $FakeOptional<ClassLet>
1278
1255
%0b2 = unchecked_enum_data %0b : $FakeOptional<ClassLet>, #FakeOptional.some!enumelt
1279
- %2 = ref_element_addr %0b2 : $ClassLet, #ClassLet.aLet
1256
+ %2 = ref_element_addr [immutable] %0b2 : $ClassLet, #ClassLet.aLet
1280
1257
%3 = load [copy] %2 : $*Klass
1281
1258
apply %f(%3) : $@convention(thin) (@guaranteed Klass) -> ()
1282
1259
destroy_value %3 : $Klass
@@ -1520,12 +1497,9 @@ bbEnd:
1520
1497
return %9999 : $()
1521
1498
}
1522
1499
1523
- // Just make sure that we do not crash on this code and convert the 2nd load
1524
- // [copy] to a load_borrow.
1500
+ // Just make sure that we do not crash on this code
1525
1501
//
1526
1502
// CHECK-LABEL: sil [ossa] @improper_dead_end_block_crasher_test : $@convention(thin) (Builtin.RawPointer) -> () {
1527
- // CHECK: load_borrow
1528
- // CHECK: load_borrow
1529
1503
// CHECK: } // end sil function 'improper_dead_end_block_crasher_test'
1530
1504
sil [ossa] @improper_dead_end_block_crasher_test : $@convention(thin) (Builtin.RawPointer) -> () {
1531
1505
bb0(%0 : $Builtin.RawPointer):
0 commit comments