File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1826,6 +1826,9 @@ void MemoryToRegisters::removeSingleBlockAllocation(AllocStackInst *asi) {
1826
1826
if (!sbi) {
1827
1827
continue ;
1828
1828
}
1829
+ if (sbi->getDest () != asi) {
1830
+ continue ;
1831
+ }
1829
1832
if (!runningVals.hasValue ()) {
1830
1833
continue ;
1831
1834
}
Original file line number Diff line number Diff line change @@ -501,3 +501,28 @@ bb1:
501
501
return %6 : $()
502
502
}
503
503
504
+ // CHECK-LABEL: sil [ossa] @test_nested_sbi :
505
+ // CHECK: alloc_stack
506
+ // CHECK-NOT: alloc_stack [lexical]
507
+ // CHECK-LABEL: } // end sil function 'test_nested_sbi'
508
+ sil [ossa] @test_nested_sbi : $@convention(thin) (@guaranteed WrapperStruct) -> () {
509
+ bb0(%0 : @guaranteed $WrapperStruct):
510
+ %2 = alloc_stack [lexical] $WrapperStruct
511
+ %3 = store_borrow %0 to %2 : $*WrapperStruct
512
+ %6 = load_borrow %3 : $*WrapperStruct
513
+ %7 = alloc_stack [lexical] $WrapperStruct
514
+ %8 = store_borrow %6 to %7 : $*WrapperStruct
515
+ %9 = struct_element_addr %8 : $*WrapperStruct, #WrapperStruct.val
516
+ %16 = load_borrow %9 : $*Klass
517
+ end_borrow %16 : $Klass
518
+ end_borrow %8 : $*WrapperStruct
519
+ dealloc_stack %7 : $*WrapperStruct
520
+ end_borrow %6 : $WrapperStruct
521
+ %27 = load_borrow %3 : $*WrapperStruct
522
+ end_borrow %27 : $WrapperStruct
523
+ end_borrow %3 : $*WrapperStruct
524
+ dealloc_stack %2 : $*WrapperStruct
525
+ %33 = tuple ()
526
+ return %33 : $()
527
+ }
528
+
You can’t perform that action at this time.
0 commit comments