File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed
SwiftCompilerSources/Sources/Optimizer/FunctionPasses Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -268,14 +268,13 @@ private extension BasicBlockRange {
268
268
/// Returns true if there is a direct edge connecting this range with the `otherRange`.
269
269
func hasControlFlowEdge( to otherRange: BasicBlockRange ) -> Bool {
270
270
func isOnlyInOtherRange( _ block: BasicBlock ) -> Bool {
271
- return !inclusiveRangeContains( block) &&
272
- otherRange. inclusiveRangeContains ( block) && block != otherRange. begin
271
+ return !inclusiveRangeContains( block) && otherRange. inclusiveRangeContains ( block)
273
272
}
274
273
275
274
for lifeBlock in inclusiveRange {
276
275
assert ( otherRange. inclusiveRangeContains ( lifeBlock) , " range must be a subset of other range " )
277
276
for succ in lifeBlock. successors {
278
- if isOnlyInOtherRange ( succ) {
277
+ if isOnlyInOtherRange ( succ) && succ != otherRange . begin {
279
278
return true
280
279
}
281
280
// The entry of the begin-block is conceptually not part of the range. We can check if
Original file line number Diff line number Diff line change @@ -1156,3 +1156,28 @@ bb0(%0 : $UnownedLink):
1156
1156
%r = tuple ()
1157
1157
return %r : $()
1158
1158
}
1159
+
1160
+ // CHECK-LABEL: sil @inner_liferange_jumps_to_outer_in_header_block
1161
+ // CHECK: alloc_ref $XX
1162
+ // CHECK-LABEL: } // end sil function 'inner_liferange_jumps_to_outer_in_header_block'
1163
+ sil @inner_liferange_jumps_to_outer_in_header_block : $@convention(thin) (@owned XX) -> () {
1164
+ bb0(%0 : $XX):
1165
+ %1 = alloc_stack $XX
1166
+ br bb1(%0 : $XX)
1167
+
1168
+ bb1(%2 : $XX):
1169
+ strong_release %2 : $XX
1170
+ %4 = alloc_ref $XX
1171
+ store %4 to %1 : $*XX
1172
+ cond_br undef, bb2, bb3
1173
+
1174
+ bb2:
1175
+ br bb1(%4 : $XX)
1176
+
1177
+ bb3:
1178
+ strong_release %4 : $XX
1179
+ dealloc_stack %1 : $*XX
1180
+ %r = tuple ()
1181
+ return %r : $()
1182
+ }
1183
+
You can’t perform that action at this time.
0 commit comments