Skip to content

Commit 3bbea52

Browse files
committed
- fixes
1 parent 997eddd commit 3bbea52

17 files changed

+66
-44
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ extension InstructionRange {
625625
case let endBorrow as EndBorrowInst:
626626
self.insert(endBorrow)
627627
case let branch as BranchInst:
628-
worklist.pushIfNotVisited(branch.getArgument(for: use))
628+
worklist.pushIfNotVisited(branch.getArgument(for: use).lookThroughBorrowedFromUser)
629629
default:
630630
break
631631
}

SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension BorrowedFromInst : VerifyableInstruction {
6565
defer { existingEVs.deinitialize() }
6666

6767
for computedEV in enclosingValues {
68-
precondition(existingEVs.contains(computedEV),
68+
require(existingEVs.contains(computedEV),
6969
"\(computedEV)\n missing in enclosing values of \(self)")
7070
}
7171
}
@@ -76,14 +76,14 @@ private extension Argument {
7676
if let phi = Phi(self), phi.value.ownership == .guaranteed {
7777
var forwardingBorrowedFromFound = false
7878
for use in phi.value.uses {
79-
precondition(use.instruction is BorrowedFromInst,
79+
require(use.instruction is BorrowedFromInst,
8080
"guaranteed phi: \(self)\n has non borrowed-from use: \(use)")
8181
if use.index == 0 {
82-
precondition(!forwardingBorrowedFromFound, "phi \(self) has multiple forwarding borrowed-from uses")
82+
require(!forwardingBorrowedFromFound, "phi \(self) has multiple forwarding borrowed-from uses")
8383
forwardingBorrowedFromFound = true
8484
}
8585
}
86-
precondition(forwardingBorrowedFromFound,
86+
require (forwardingBorrowedFromFound,
8787
"missing forwarding borrowed-from user of guaranteed phi \(phi)")
8888
}
8989
}

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bool swift::findPointerEscape(SILValue original) {
3434

3535
ValueWorklist worklist(original->getFunction());
3636
worklist.push(original);
37-
if (auto *phi = SILArgument::asPhi(original)) {
37+
if (auto *phi = SILArgument::asPhi(lookThroughBorrowedFromDef(original))) {
3838
phi->visitTransitiveIncomingPhiOperands([&](auto *phi, auto *operand) {
3939
worklist.pushIfNotVisited(operand->get());
4040
return true;

lib/SILOptimizer/Transforms/DeadCodeElimination.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void DCE::markLive() {
285285
break;
286286
}
287287
case SILInstructionKind::EndBorrowInst: {
288-
auto phi = PhiValue(I.getOperand(0));
288+
auto phi = PhiValue(lookThroughBorrowedFromDef(I.getOperand(0)));
289289
// If there is a pointer escape or phi is lexical, disable DCE.
290290
if (phi && (findPointerEscape(phi) || phi->isLexical())) {
291291
markInstructionLive(&I);

lib/SILOptimizer/Utils/InstOptUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ bool swift::isInstructionTriviallyDead(SILInstruction *inst) {
171171
if (isa<DebugValueInst>(inst))
172172
return false;
173173

174+
// A dead borrowed-from can only be removed if the argument (= operand) is also removed.
175+
if (isa<BorrowedFromInst>(inst))
176+
return false;
177+
174178
// These invalidate enums so "write" memory, but that is not an essential
175179
// operation so we can remove these if they are trivially dead.
176180
if (isa<UncheckedTakeEnumDataAddrInst>(inst))

test/SILOptimizer/copy_propagation_borrow.sil

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,9 @@ bb0(%0 : @guaranteed $HasObject):
565565
// CHECK: br bb3([[CP]] : $C, [[BORROW]] : $C)
566566
// CHECK: bb2:
567567
// CHECK: br bb3([[CP]] : $C, [[BORROW]] : $C)
568-
// CHECK: bb3([[OWNEDPHI:%.*]] : @owned $C, [[BORROWPHI:%.*]] @reborrow @guaranteed $C
569-
// CHECK: end_borrow [[BORROWPHI]]
568+
// CHECK: bb3([[OWNEDPHI:%.*]] : @owned $C, [[BORROWPHI:%.*]] : @reborrow @guaranteed $C):
569+
// CHECK: [[R:%.*]] = borrowed [[BORROWPHI]] : $C from (%0 : $C)
570+
// CHECK: end_borrow [[R]]
570571
// CHECK: destroy_value [[OWNEDPHI]] : $C
571572
// CHECK: destroy_value %0 : $C
572573
// CHECK-LABEL: } // end sil function 'testSubReborrowExtension'
@@ -605,8 +606,9 @@ bb3(%phi : @owned $C, %borrowphi : @guaranteed $C):
605606
// CHECK-LABEL: sil [ossa] @testLiveCopyAfterReborrow : $@convention(thin) () -> () {
606607
// CHECK: [[ALLOC:%.*]] = alloc_ref $C
607608
// CHECK: bb3([[BORROWPHI:%.*]] : @reborrow @guaranteed $C):
608-
// CHECK: [[COPY:%.*]] = copy_value [[BORROWPHI]]
609-
// CHECK: end_borrow [[BORROWPHI]] : $C
609+
// CHECK: [[R:%.*]] = borrowed [[BORROWPHI]] : $C from (%0 : $C)
610+
// CHECK: [[COPY:%.*]] = copy_value [[R]]
611+
// CHECK: end_borrow [[R]] : $C
610612
// CHECK-NOT: copy_value
611613
// CHECK-NOT: destroy_value
612614
// CHECK: apply
@@ -653,8 +655,9 @@ bb3(%borrowphi : @guaranteed $C):
653655
// CHECK-LABEL: sil [ossa] @testDeadCopyAfterReborrow : $@convention(thin) () -> () {
654656
// CHECK: [[ALLOC:%.*]] = alloc_ref $C
655657
// CHECK: bb3([[BORROWPHI:%.*]] : @reborrow @guaranteed $C):
658+
// CHECK: [[R:%.*]] = borrowed [[BORROWPHI]] : $C from (%0 : $C)
656659
// CHECK-NOT: copy_value
657-
// CHECK: end_borrow [[BORROWPHI]] : $C
660+
// CHECK: end_borrow [[R]] : $C
658661
// CHECK-NOT: copy_value
659662
// CHECK: destroy_value [[ALLOC]] : $C
660663
// CHECK-LABEL: } // end sil function 'testDeadCopyAfterReborrow'
@@ -693,8 +696,9 @@ bb3(%borrowphi : @guaranteed $C):
693696
// CHECK-LABEL: sil [ossa] @testNestedReborrowOutsideUse : $@convention(thin) () -> () {
694697
// CHECK: [[ALLOC:%.*]] = alloc_ref $C
695698
// CHECK: bb3([[BORROWPHI:%.*]] : @reborrow @guaranteed $C):
699+
// CHECK: [[R:%.*]] = borrowed [[BORROWPHI]] : $C from (%0 : $C)
696700
// CHECK-NOT: copy
697-
// CHECK: end_borrow [[BORROWPHI]]
701+
// CHECK: end_borrow [[R]]
698702
// CHECK-NEXT: destroy_value [[ALLOC]] : $C
699703
// CHECK-LABEL: } // end sil function 'testNestedReborrowOutsideUse'
700704
sil [ossa] @testNestedReborrowOutsideUse : $@convention(thin) () -> () {

test/SILOptimizer/copy_propagation_canonicalize_with_reborrows.sil

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ exit:
182182
// the reborrow occurs.
183183
// CHECK-LABEL: sil [ossa] @reborrow_adjacent_to_consume_doesnt_extend_lifetime : {{.*}} {
184184
// CHECK: bb1([[REBORROW:%[^,]+]] : @reborrow @guaranteed $X, [[VALUE:%[^,]+]] :
185+
// CHECK: [[R:%.*]] = borrowed [[REBORROW]] : $X from ([[VALUE]] : $X)
185186
// CHECK: {{bb[0-9]+}}:
186-
// CHECK: end_borrow [[REBORROW]]
187+
// CHECK: end_borrow [[R]]
187188
// CHECK: destroy_value [[VALUE]]
188189
// CHECK-LABEL: } // end sil function 'reborrow_adjacent_to_consume_doesnt_extend_lifetime'
189190
sil [ossa] @reborrow_adjacent_to_consume_doesnt_extend_lifetime : $@convention(thin) (@owned X) -> () {
@@ -305,8 +306,10 @@ bb1(%4 : @guaranteed $X, %5 : @owned $X):
305306
//
306307
// CHECK-LABEL: sil [ossa] @reborrow_adjacent_to_consume : $@convention(thin) () -> () {
307308
// CHECK: bb1(%{{.*}} : @reborrow @guaranteed $X, %{{.*}} : @owned $X):
309+
// CHECK-NEXT: borrowed
308310
// CHECK-NEXT: br bb2
309311
// CHECK: bb2(%{{.*}} : @reborrow @guaranteed $X, %{{.*}} : @owned $X):
312+
// CHECK-NEXT: borrowed
310313
// CHECK-NEXT: end_borrow
311314
// CHECK-NEXT: destroy_value
312315
sil [ossa] @reborrow_adjacent_to_consume : $@convention(thin) () -> () {
@@ -337,8 +340,10 @@ bb2(%6 : @guaranteed $X, %7 : @owned $X):
337340
//
338341
// CHECK-LABEL: sil [ossa] @reborrow_no_adjacent_consume : $@convention(thin) () -> () {
339342
// CHECK: bb1(%{{.*}} : @reborrow @guaranteed $X, %{{.*}} : @owned $X):
343+
// CHECK-NEXT: borrowed
340344
// CHECK-NEXT: br bb2
341345
// CHECK: bb2(%{{.*}} : @reborrow @guaranteed $X):
346+
// CHECK-NEXT: borrowed
342347
// CHECK-NEXT: end_borrow
343348
// CHECK-NEXT: destroy_value
344349
sil [ossa] @reborrow_no_adjacent_consume : $@convention(thin) () -> () {

test/SILOptimizer/cse_ossa.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all %s -cse | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all %s -update-borrowed-from -cse | %FileCheck %s
22
sil_stage canonical
33

44
import Builtin

test/SILOptimizer/cse_ossa_nontrivial.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all %s -cse | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all %s -update-borrowed-from -cse | %FileCheck %s
22
sil_stage canonical
33

44
import Builtin

test/SILOptimizer/dead_code_elimination_nontrivial_ossa.sil

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all -dce %s | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all -update-borrowed-from -dce %s | %FileCheck %s
22

33
sil_stage canonical
44

@@ -803,7 +803,8 @@ exit:
803803
// CHECK: [[OUTER_LIFETIME_1:%[^,]+]] = begin_borrow [[INSTANCE]]
804804
// CHECK: br [[EXIT:bb[0-9]+]]([[OUTER_LIFETIME_1]] : $Klass)
805805
// CHECK: [[EXIT]]([[OUTER_LIFETIME_2:%[^,]+]] : @reborrow @guaranteed $Klass):
806-
// CHECK: end_borrow [[OUTER_LIFETIME_2]]
806+
// CHECK: [[R:%.*]] = borrowed [[OUTER_LIFETIME_2]] : $Klass from (%0 : $Klass)
807+
// CHECK: end_borrow [[R]]
807808
// CHECK: destroy_value [[INSTANCE]]
808809
// CHECK: [[RETVAL:%[^,]+]] = tuple ()
809810
// CHECK: return [[RETVAL]]
@@ -826,9 +827,11 @@ exit(%outer_lifetime_2 : @guaranteed $Klass, %inner_lifetime_2 : @guaranteed $Kl
826827
// CHECK: [[LIFETIME:%[^,]+]] = begin_borrow [[INSTANCE]]
827828
// CHECK: br [[WORK:bb[0-9]+]]([[LIFETIME]] : $Klass)
828829
// CHECK: [[WORK]]([[LIFETIME_1:%[^,]+]] : @reborrow @guaranteed $Klass):
829-
// CHECK: br [[EXIT:bb[0-9]+]]([[LIFETIME_1]] : $Klass)
830+
// CHECK: [[R:%.*]] = borrowed [[LIFETIME_1]] : $Klass from (%0 : $Klass)
831+
// CHECK: br [[EXIT:bb[0-9]+]]([[R]] : $Klass)
830832
// CHECK: [[EXIT]]([[LIFETIME_2:%[^,]+]] : @reborrow @guaranteed $Klass):
831-
// CHECK: end_borrow [[LIFETIME_2]]
833+
// CHECK: [[R2:%.*]] = borrowed [[LIFETIME_2]] : $Klass from (%0 : $Klass)
834+
// CHECK: end_borrow [[R2]]
832835
// CHECK: destroy_value [[INSTANCE]]
833836
// CHECK: [[RETVAL:%[^,]+]] = tuple ()
834837
// CHECK: return [[RETVAL]] : $()
@@ -908,7 +911,8 @@ exit(%inner_lifetime_2 : @guaranteed $Klass):
908911
// CHECK: [[LIFETIME:%[^,]+]] = load_borrow [[INSTANCE]]
909912
// CHECK: br [[BASIC_BLOCK1:bb[0-9]+]]([[LIFETIME]] : $Klass)
910913
// CHECK: [[BASIC_BLOCK1]]([[LIFETIME_2:%[^,]+]] : @reborrow @guaranteed $Klass):
911-
// CHECK: end_borrow [[LIFETIME_2]]
914+
// CHECK: [[R:%.*]] = borrowed [[LIFETIME_2]] : $Klass from ()
915+
// CHECK: end_borrow [[R]]
912916
// CHECK: [[RETVAL:%[^,]+]] = tuple ()
913917
// CHECK: return [[RETVAL]]
914918
// CHECK-LABEL: } // end sil function 'reborrow_load_borrow'
@@ -929,7 +933,8 @@ bb1(%4 : @guaranteed $Klass, %5 : @guaranteed $Klass):
929933
// CHECK: [[LIFETIME:%[^,]+]] = load_borrow [[ADDR]] : $*Klass
930934
// CHECK: br [[EXIT:bb[0-9]+]]([[LIFETIME]] : $Klass)
931935
// CHECK: [[EXIT]]([[LIFETIME_2:%[^,]+]] : @reborrow @guaranteed $Klass):
932-
// CHECK: end_borrow [[LIFETIME_2]] : $Klass
936+
// CHECK: [[R:%.*]] = borrowed [[LIFETIME_2]] : $Klass from ()
937+
// CHECK: end_borrow [[R]] : $Klass
933938
// CHECK: [[EXIT:%[^,]+]] = tuple ()
934939
// CHECK: return [[EXIT]] : $()
935940
// CHECK-LABEL: } // end sil function 'reborrow_load_borrow2'

test/SILOptimizer/field_sensitive_liverange_unit.sil

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sil @getC : $@convention(thin) () -> (@owned C)
1212
// CHECK-LABEL: testReborrow: fieldsensitive-multidefuse-liverange
1313
// CHECK: FieldSensitive MultiDef lifetime analysis:
1414
// CHECK: def in range [0, 1) value: [[B:%.*]] = load_borrow %0 : $*C
15-
// CHECK: def in range [0, 1) value: [[RB:%.*]] = argument of bb3 : $C
15+
// CHECK: def in range [0, 1) value: [[RB:%.*]] = borrowed {{.*}} from
1616
// CHECK-NEXT: bb2: LiveWithin
1717
// CHECK-NEXT: bb3: LiveWithin
1818
// All users are printed here.
@@ -30,7 +30,7 @@ bb0:
3030
@trace[1] 0 1
3131
uses:
3232
@block[2].instruction[3] true 0 1
33-
@block[3].instruction[0] true 0 1
33+
@block[3].instruction[1] true 0 1
3434
"""
3535
%stack = alloc_stack $C
3636
%getC = function_ref @getC : $@convention(thin) () -> (@owned C)
@@ -49,7 +49,8 @@ bb2:
4949
debug_value [trace] %borrow2 : $C
5050
br bb3(%borrow2 : $C)
5151

52-
bb3(%reborrow : @guaranteed $C):
52+
bb3(%a : @guaranteed $C):
53+
%reborrow = borrowed %a : $C from ()
5354
debug_value [trace] %reborrow : $C
5455
end_borrow %reborrow : $C
5556
br bb4

test/SILOptimizer/let-property-lowering.sil

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt %s -let-property-lowering | %FileCheck %s
1+
// RUN: %target-sil-opt %s -update-borrowed-from -let-property-lowering | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44

@@ -291,7 +291,8 @@ bb2:
291291

292292
// CHECK-LABEL: sil [ossa] @test_reborrow :
293293
// CHECK: bb1([[A:%.*]] : @reborrow @guaranteed $C):
294-
// CHECK: end_borrow [[A]]
294+
// CHECK: [[R:%.*]] = borrowed [[A]] : $C from (%2 : $C)
295+
// CHECK: end_borrow [[R]]
295296
// CHECK-NEXT: end_init_let_ref %2
296297
// CHECK: } // end sil function 'test_reborrow'
297298
sil [ossa] @test_reborrow : $@convention(thin) (@owned C, Int) -> @owned C {

test/SILOptimizer/lexical_destroy_hoisting.sil

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -compute-side-effects -copy-propagation -enable-sil-verify-all %s | %FileCheck %s
1+
// RUN: %target-sil-opt -update-borrowed-from -compute-side-effects -copy-propagation -enable-sil-verify-all %s | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44

@@ -187,7 +187,8 @@ exit:
187187
// CHECK: [[LIFETIME:%[^,]+]] = begin_borrow [[INSTANCE]]
188188
// CHECK: br [[WORK:bb[0-9]+]]([[LIFETIME]] : $C)
189189
// CHECK: [[WORK]]([[LIFETIME_2:%[^,]+]] : @reborrow @guaranteed $C):
190-
// CHECK: end_borrow [[LIFETIME_2]]
190+
// CHECK: [[R:%.*]] = borrowed [[LIFETIME_2]] : $C from (%0 : $C)
191+
// CHECK: end_borrow [[R]]
191192
// CHECK: tuple ()
192193
// CHECK: destroy_value [[INSTANCE]]
193194
// CHECK: br

test/SILOptimizer/liveness_unit.sil

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -test-runner %s -o /dev/null 2>&1 | %FileCheck %s
1+
// RUN: %target-sil-opt -update-borrowed-from -test-runner %s -o /dev/null 2>&1 | %FileCheck %s
22

33
sil_stage canonical
44

@@ -80,7 +80,7 @@ bb3:
8080
// CHECK-LABEL: testReborrow: multidef_liveness
8181
// CHECK: MultiDef lifetime analysis:
8282
// CHECK: def value: [[B:%.*]] = begin_borrow %0 : $C
83-
// CHECK: def value: [[RB:%.*]] = argument of bb3 : $C
83+
// CHECK: def value: [[RB:%.*]] = borrowed {{.*}} from (%0 : $C)
8484
// CHECK-NEXT: bb2: LiveWithin
8585
// CHECK-NEXT: bb3: LiveWithin
8686
// CHECK-NEXT: lifetime-ending user: br bb3([[B]] : $C)
@@ -225,10 +225,10 @@ bb4(%phi : @owned $C):
225225
// CHECK-LABEL: testSSADeadRefElementAddr: ssa_liveness
226226
// CHECK: SSA lifetime analysis: %0 = argument of bb0 : $C
227227
// CHECK-NEXT: bb0: LiveOut
228-
// CHECK-NEXT: bb2: LiveOut
229228
// CHECK-NEXT: bb3: LiveWithin
229+
// CHECK-NEXT: bb2: LiveOut
230230
// CHECK-NEXT: bb1: LiveOut
231-
// CHECK: ref_element_addr %6 : $D, #D.object
231+
// CHECK: ref_element_addr %7 : $D, #D.object
232232
// CHECK-NEXT-LABEL: end running test 1 of 1 on testSSADeadRefElementAddr: ssa_liveness
233233
sil [ossa] @testSSADeadRefElementAddr : $@convention(thin) (@guaranteed C) -> () {
234234
bb0(%0 : @guaranteed $C):
@@ -254,8 +254,9 @@ bb3(%phi : @guaranteed $D):
254254
// CHECK-LABEL: testSSAInnerReborrowedPhi: ssa_liveness
255255
// CHECK: SSA lifetime analysis: %0 = argument of bb0 : $C
256256
// CHECK-NEXT: Incomplete liveness: Reborrowed inner scope
257-
// CHECK-NEXT: bb0: LiveWithin
258-
// CHECK-NEXT: dead def: %0 = argument of bb0 : $C
257+
// CHECK-NEXT: bb0: LiveOut
258+
// CHECK-NEXT: bb1: LiveWithin
259+
// CHECK-NEXT: regular user: %7 = borrowed %4 : $C from (%0 : $C)
259260
sil [ossa] @testSSAInnerReborrowedPhi : $@convention(thin) (@guaranteed C) -> () {
260261
bb0(%0 : @guaranteed $C):
261262
specify_test "ssa_liveness @argument[0]"
@@ -283,12 +284,11 @@ bb1(%reborrow : @guaranteed $C, %phi : @guaranteed $PairC):
283284
// CHECK-LABEL: testSSADeadGuaranteedPhi: ssa_liveness
284285
// CHECK: SSA lifetime analysis: %0 = argument of bb0 : $C
285286
// CHECK-NEXT: bb0: LiveOut
286-
// CHECK-NEXT: bb2: LiveWithin
287-
// CHECK-NEXT: bb1: LiveWithin
287+
// CHECK-NEXT: bb3: LiveWithin
288+
// CHECK-NEXT: bb2: LiveOut
289+
// CHECK-NEXT: bb1: LiveOut
288290
// CHECK-NEXT: regular user
289-
// CHECK: last user:
290-
// CHECK-SAME: br bb3
291-
// CHECK-NEXT: last user: br bb3
291+
// CHECK: last user: %7 = borrowed %6 : $D from (%0 : $C)
292292
// CHECK-NEXT: end running
293293
sil [ossa] @testSSADeadGuaranteedPhi : $@convention(thin) (@guaranteed C) -> () {
294294
bb0(%0 : @guaranteed $C):
@@ -313,9 +313,10 @@ bb3(%deadPhi : @guaranteed $D):
313313
// CHECK-LABEL: testSSADominatedPhi: ssa_liveness
314314
// CHECK: SSA lifetime analysis: %0 = argument of bb0 : $C
315315
// CHECK-NEXT: bb0: LiveOut
316-
// CHECK-NEXT: bb2: LiveOut
317316
// CHECK-NEXT: bb3: LiveWithin
317+
// CHECK-NEXT: bb2: LiveOut
318318
// CHECK-NEXT: bb1: LiveOut
319+
// CHECK-NEXT: regular user: %{{.*}} = borrowed %6 : $D from (%0 : $C)
319320
// CHECK-NEXT: regular user: %{{.*}} = unchecked_ref_cast %0 : $C to $D
320321
// CHECK-NEXT: regular user: br bb3
321322
// CHECK-NEXT: regular user: %{{.*}} = load

test/SILOptimizer/loop_unroll_ossa.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all -loop-unroll %s | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all -update-borrowed-from -loop-unroll %s | %FileCheck %s
22

33
sil_stage canonical
44

test/SILOptimizer/looprotate_nontrivial_ossa.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -loop-rotate -looprotate-single-block-loop=true %s | %FileCheck %s
1+
// RUN: %target-sil-opt -loop-rotate -update-borrowed-from -looprotate-single-block-loop=true %s | %FileCheck %s
22
sil_stage canonical
33

44
import Builtin

test/SILOptimizer/ossa_rauw_tests.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all -sil-combine -semantic-arc-opts %s | %FileCheck %s
1+
// RUN: %target-sil-opt -enable-sil-verify-all -update-borrowed-from -sil-combine -semantic-arc-opts %s | %FileCheck %s
22

33
// Make sure that we can perform all of these RAUW without producing ARC traffic
44
// that semantic arc opts can't eliminate.

0 commit comments

Comments
 (0)