Skip to content

Commit ac30d86

Browse files
Merge pull request swiftlang#40556 from nate-chandler/copy_propagation/always-on
Always enable copy propagation.
2 parents 184488d + 7d7acb4 commit ac30d86

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

include/swift/AST/SILOptions.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,15 @@ class SILOptions {
7474
/// Remove all runtime assertions during optimizations.
7575
bool RemoveRuntimeAsserts = false;
7676

77-
/// Enable experimental support for emitting defined borrow scopes.
78-
LexicalLifetimesOption LexicalLifetimes =
79-
LexicalLifetimesOption::DiagnosticMarkersOnly;
77+
/// Both emit lexical markers and use them to extend object lifetime to the
78+
/// observable end of lexical scope.
79+
LexicalLifetimesOption LexicalLifetimes = LexicalLifetimesOption::On;
8080

8181
/// Whether to run SIL copy propagation to shorten object lifetime in whatever
8282
/// optimization pipeline is currently used.
8383
///
84-
/// When this is 'RequestedPassesOnly' the pipeline has default behavior.
85-
CopyPropagationOption CopyPropagation =
86-
CopyPropagationOption::RequestedPassesOnly;
84+
/// When this is 'On' the pipeline has default behavior.
85+
CopyPropagationOption CopyPropagation = CopyPropagationOption::On;
8786

8887
/// Controls whether the SIL ARC optimizations are run.
8988
bool EnableARCOptimizations = true;

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,7 @@ function(add_swift_target_library name)
17191719
if (SWIFTLIB_IS_STDLIB)
17201720
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-warn-implicit-overrides")
17211721
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-ossa-modules")
1722+
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-lexical-lifetimes=false")
17221723
endif()
17231724

17241725
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER AND NOT BUILD_STANDALONE AND

test/sil-passpipeline-dump/basic.test-sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
// CHECK: ---
44
// CHECK: name: non-Diagnostic Enabling Mandatory Optimizations
5-
// CHECK: passes: [ "for-each-loop-unroll", "mandatory-combine", "mandatory-arc-opts" ]
5+
// CHECK: passes: [ "for-each-loop-unroll", "mandatory-combine", "mandatory-copy-propagation",
6+
// CHECK: "mandatory-arc-opts" ]
67
// CHECK: ---
78
// CHECK: name: Serialization
89
// CHECK: passes: [ "serialize-sil", "ownership-model-eliminator" ]

0 commit comments

Comments
 (0)