Skip to content

Commit 1440ae7

Browse files
committed
EscapeInfo: handle is_unique
1 parent da5857d commit 1440ae7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ fileprivate struct EscapeWalker<V: EscapeVisitor> : ValueDefUseWalker,
556556
case let atp as AddressToPointerInst:
557557
return walkDownUses(ofValue: atp, path: path.with(knownType: nil))
558558
case is DeallocStackInst, is InjectEnumAddrInst, is FixLifetimeInst, is EndBorrowInst, is EndAccessInst,
559-
is DebugValueInst:
559+
is IsUniqueInst, is DebugValueInst:
560560
return .continueWalk
561561
default:
562562
return isEscaping

test/SILOptimizer/addr_escape_info.sil

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,3 +796,18 @@ bb0:
796796
return %r : $()
797797
}
798798

799+
// CHECK-LABEL: Address escape information for test_is_unique:
800+
// CHECK: value: %1 = alloc_stack $X
801+
// CHECK-NEXT: End function test_is_unique
802+
sil [ossa] @test_is_unique : $@convention(thin) (@owned X) -> () {
803+
bb0(%0 : @owned $X):
804+
%1 = alloc_stack $X
805+
store %0 to [init] %1 : $*X
806+
fix_lifetime %1 : $*X
807+
%3 = is_unique %1 : $*X
808+
destroy_addr %1 : $*X
809+
dealloc_stack %1 : $*X
810+
%4 = tuple ()
811+
return %4 : $()
812+
}
813+

0 commit comments

Comments
 (0)