File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -70,13 +70,11 @@ void ReleaseDevirtualizer::run() {
70
70
SILFunction *F = getFunction ();
71
71
RCIA = PM->getAnalysis <RCIdentityAnalysis>()->get (F);
72
72
73
+ // The last release_value or strong_release instruction before the
74
+ // deallocation.
75
+ SILInstruction *LastRelease = nullptr ;
73
76
bool Changed = false ;
74
77
for (SILBasicBlock &BB : *F) {
75
-
76
- // The last release_value or strong_release instruction before the
77
- // deallocation.
78
- SILInstruction *LastRelease = nullptr ;
79
-
80
78
for (SILInstruction &I : BB) {
81
79
if (LastRelease) {
82
80
if (auto *DRI = dyn_cast<DeallocRefInst>(&I)) {
Original file line number Diff line number Diff line change 93
93
return %r : $()
94
94
}
95
95
96
+ // CHECK-LABEL: sil @devirtualize_release_multiblock
97
+ // CHECK-NOT: strong_release
98
+ // CHECK: [[A:%[0-9]+]] = alloc_ref
99
+ // CHECK-NEXT: set_deallocating [[A]]
100
+ // CHECK: [[D:%[0-9]+]] = function_ref @$s4test1BCfD
101
+ // CHECK-NEXT: apply [[D]]([[A]])
102
+ // CHECK-NEXT: br
103
+ // CHECK: bb1:
104
+ // CHECK-NEXT: dealloc_ref [stack] [[A]]
105
+ // CHECK: return
106
+ sil @devirtualize_release_multiblock : $@convention(thin) () -> () {
107
+ bb0:
108
+ %1 = alloc_ref [stack] $B
109
+ strong_release %1 : $B
110
+ br bb1
111
+
112
+ bb1:
113
+ dealloc_ref [stack] %1 : $B
114
+ %r = tuple ()
115
+ return %r : $()
116
+ }
96
117
97
118
sil @unknown_func : $@convention(thin) () -> ()
98
119
You can’t perform that action at this time.
0 commit comments