File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -782,6 +782,8 @@ bool CanonicalizeBorrowScope::canonicalizeFunctionArgument(
782
782
783
783
initBorrow (BorrowedValue (arg));
784
784
785
+ SWIFT_DEFER { liveness.clear (); };
786
+
785
787
RewriteInnerBorrowUses innerRewriter (*this );
786
788
beginVisitBorrowScopeUses (); // reset the def/use worklist
787
789
bool succeed = visitBorrowScopeUses (borrowedValue.value , innerRewriter);
Original file line number Diff line number Diff line change 1
1
// RUN: %target-sil-opt -enable-objc-interop -enforce-exclusivity=none -enable-sil-verify-all %s -sil-combine | %FileCheck %s
2
2
// RUN: %target-sil-opt -enable-objc-interop -enforce-exclusivity=none -enable-sil-verify-all %s -sil-combine -generic-specializer | %FileCheck %s --check-prefix=CHECK_FORWARDING_OWNERSHIP_KIND
3
+ // RUN: %target-sil-opt -enable-objc-interop -enforce-exclusivity=none -enable-sil-verify-all %s -sil-combine -enable-copy-propagation
3
4
4
5
// Declare this SIL to be canonical because some tests break raw SIL
5
6
// conventions. e.g. address-type block args. -enforce-exclusivity=none is also
@@ -5087,3 +5088,21 @@ bb0(%0 : @guaranteed $Function):
5087
5088
destroy_value %6 : $Optional<@callee_guaranteed (MyInt) -> Double>
5088
5089
return %13 : $Double
5089
5090
}
5091
+
5092
+ sil [reabstraction_thunk] @thunk : $@convention(thin) (@guaranteed Klass, @guaranteed Klass) -> ()
5093
+
5094
+ // CHECK-LABEL: sil [ossa] @test_partial_apply_apply_opt :
5095
+ // CHECK-NOT: partial_apply
5096
+ // CHECK: } // end sil function 'test_partial_apply_apply_opt'
5097
+ sil [ossa] @test_partial_apply_apply_opt : $@convention(thin) (@guaranteed Klass, @guaranteed Klass) -> () {
5098
+ bb0(%0 : @guaranteed $Klass, %1 : @guaranteed $Klass):
5099
+ %c1 = copy_value %0 : $Klass
5100
+ %c2 = copy_value %1 : $Klass
5101
+ %f1 = function_ref @thunk : $@convention(thin) (@guaranteed Klass, @guaranteed Klass) -> ()
5102
+ %p1 = partial_apply [callee_guaranteed] %f1(%c1, %c2) : $@convention(thin) (@guaranteed Klass, @guaranteed Klass) -> ()
5103
+ %r = apply %p1() : $@callee_guaranteed () -> ()
5104
+ destroy_value %p1 : $@callee_guaranteed () -> ()
5105
+ %7 = tuple ()
5106
+ return %7 : $()
5107
+ }
5108
+
You can’t perform that action at this time.
0 commit comments