File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
lib/SILOptimizer/SILCombiner Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,8 @@ SILInstruction *SILCombiner::visitAllocRefInst(AllocRefInst *AR) {
447
447
auto *Op = *UI;
448
448
++UI;
449
449
auto *User = Op->getUser ();
450
- if (!isa<DeallocRefInst>(User) && !isa<SetDeallocatingInst>(User)) {
450
+ if (!isa<DeallocRefInst>(User) && !isa<SetDeallocatingInst>(User) &&
451
+ !isa<FixLifetimeInst>(User)) {
451
452
HasNonRemovableUses = true ;
452
453
break ;
453
454
}
Original file line number Diff line number Diff line change @@ -2413,6 +2413,20 @@ bb0(%0 : $*B):
2413
2413
return %2 : $()
2414
2414
}
2415
2415
2416
+ // CHECK-LABEL: sil @delete_dead_alloc_ref
2417
+ // CHECK: bb0
2418
+ // CHECK-NEXT: tuple
2419
+ // CHECK-NEXT: return
2420
+ sil @delete_dead_alloc_ref : $() -> () {
2421
+ bb0:
2422
+ %1 = alloc_ref $B
2423
+ set_deallocating %1 : $B
2424
+ fix_lifetime %1 : $B
2425
+ dealloc_ref %1 : $B
2426
+ %2 = tuple()
2427
+ return %2 : $()
2428
+ }
2429
+
2416
2430
// CHECK-LABEL: sil @delete_dead_alloc_stack2
2417
2431
// CHECK: bb0
2418
2432
// CHECK-NEXT: destroy_addr %0
You can’t perform that action at this time.
0 commit comments