Skip to content

Commit ae4ad5d

Browse files
authored
Merge pull request #61709 from gottesmm/pr-5e5911e54a3f7633e9de77ab5c6965b1b4eba430
Make the option sil-stop-optzns-before-lowering-ownership work at -On one
2 parents cdbc917 + 50163aa commit ae4ad5d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,10 @@ SILPassPipelinePlan::getOnonePassPipeline(const SILOptions &Options) {
986986
// Now that we have serialized, propagate debug info.
987987
P.addMovedAsyncVarDebugInfoPropagator();
988988

989+
// If we are asked to stop optimizing before lowering ownership, do so now.
990+
if (P.Options.StopOptimizationBeforeLoweringOwnership)
991+
return P;
992+
989993
// Now strip any transparent functions that still have ownership.
990994
P.addOwnershipModelEliminator();
991995

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %target-swift-frontend %s -emit-sil -sil-stop-optzns-before-lowering-ownership | %FileCheck %s
2+
// RUN: %target-swift-frontend %s -emit-sil | %FileCheck -check-prefix=NEGATIVE %s
3+
4+
// CHECK: sil hidden [ossa] @$s46stop_optzns_before_lowering_ownership_at_onone4testyyF : $@convention(thin) () -> () {
5+
// NEGATIVE: sil hidden @$s46stop_optzns_before_lowering_ownership_at_onone4testyyF : $@convention(thin) () -> () {
6+
func test() {
7+
8+
}

0 commit comments

Comments
 (0)