Skip to content

Commit 0d73a21

Browse files
committed
EscapeUtils: ignore debug_value for address types.
It has already been ignored for value types, but not for address types.
1 parent b5b055a commit 0d73a21

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,8 @@ fileprivate struct EscapeWalker<V: EscapeVisitor> : ValueDefUseWalker,
549549
case let ia as IndexAddrInst:
550550
assert(operand.index == 0)
551551
return walkDownUses(ofAddress: ia, path: path.with(knownType: nil))
552-
case is DeallocStackInst, is InjectEnumAddrInst, is FixLifetimeInst, is EndBorrowInst, is EndAccessInst:
552+
case is DeallocStackInst, is InjectEnumAddrInst, is FixLifetimeInst, is EndBorrowInst, is EndAccessInst,
553+
is DebugValueInst:
553554
return .continueWalk
554555
default:
555556
return isEscaping

test/SILOptimizer/escape_info.sil

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,3 +1305,17 @@ bb0:
13051305
return %11 : $()
13061306
}
13071307

1308+
// CHECK-LABEL: Escape information for test_debug_value:
1309+
// CHECK: - : %0 = alloc_ref $Y
1310+
// CHECK: - : %1 = alloc_ref $Z
1311+
// CHECK: End function test_debug_value
1312+
sil @test_debug_value : $@convention(thin) () -> () {
1313+
%0 = alloc_ref $Y
1314+
%1 = alloc_ref $Z
1315+
%2 = ref_element_addr %1 : $Z, #Z.y
1316+
store %0 to %2 : $*Y
1317+
debug_value %0 : $Y
1318+
debug_value %2 : $*Y
1319+
%11 = tuple ()
1320+
return %11 : $()
1321+
}

0 commit comments

Comments
 (0)