Skip to content

Commit 451252d

Browse files
committed
[sil] Add a run of ownership model eliminator in the lowering pass pipeline to ensure we eliminate ownership even if a bisecting counter has disabled the normal ome run.
I also had to fix up one test and eliminated a test that did not really make sense in the first place to test with ossa. (Specifically, copy_value_destroy_value is a test I added when adding copy_value, destroy_value, it really doesn't make sense since we will just lower it to retain, release before we hit IRGen).
1 parent 6d178e8 commit 451252d

File tree

3 files changed

+4
-46
lines changed

3 files changed

+4
-46
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ SILPassPipelinePlan
575575
SILPassPipelinePlan::getLoweringPassPipeline(const SILOptions &Options) {
576576
SILPassPipelinePlan P(Options);
577577
P.startPipeline("Address Lowering");
578+
P.addOwnershipModelEliminator();
578579
P.addIRGenPrepare();
579580
P.addAddressLowering();
580581

test/IRGen/copy_value_destroy_value.sil

Lines changed: 0 additions & 46 deletions
This file was deleted.

test/IRGen/unknown_object.sil

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ entry(%x : @guaranteed $Builtin.AnyObject):
1010
// CHECK-native: swift_retain
1111
// CHECK-objc: swift_unknownObjectRetain
1212
%y = copy_value %x : $Builtin.AnyObject
13+
br bb1
14+
15+
bb1:
1316
// CHECK-native: swift_release
1417
// CHECK-objc: swift_unknownObjectRelease
1518
destroy_value %y : $Builtin.AnyObject

0 commit comments

Comments
 (0)