Skip to content

Remove redundant flag -sil-enable-late-ome now that -enable-ossa-modules has been fixed #39594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions include/swift/SILOptimizer/PassManager/Passes.def
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ PASS(NestedSemanticFunctionCheck, "nested-semantic-function-check",
PASS(NonTransparentFunctionOwnershipModelEliminator,
"non-transparent-func-ownership-model-eliminator",
"Eliminate Ownership Annotations from non-transparent SIL Functions")
PASS(NonStdlibNonTransparentFunctionOwnershipModelEliminator,
"non-stdlib-non-transparent-func-ownership-model-eliminator",
"Eliminate Ownership Annotations from non-transparent SIL Functions only when not processing the stdlib.")
PASS(RCIdentityDumper, "rc-id-dumper",
"Print Reference Count Identities")
PASS(AlwaysInlineInliner, "always-inline",
Expand Down
6 changes: 0 additions & 6 deletions lib/SILOptimizer/Mandatory/OwnershipModelEliminator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,3 @@ SILTransform *swift::createNonTransparentFunctionOwnershipModelEliminator() {
return new OwnershipModelEliminator(true /*skip transparent*/,
false /*ignore stdlib*/);
}

SILTransform *
swift::createNonStdlibNonTransparentFunctionOwnershipModelEliminator() {
return new OwnershipModelEliminator(true /*skip transparent*/,
true /*ignore stdlib*/);
}
7 changes: 3 additions & 4 deletions lib/SILOptimizer/PassManager/PassManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,10 @@ void SILPassManager::dumpPassInfo(const char *Title, unsigned TransIdx,
}

bool SILPassManager::isMandatoryFunctionPass(SILFunctionTransform *sft) {
return isMandatory || sft->getPassKind() ==
PassKind::NonTransparentFunctionOwnershipModelEliminator ||
sft->getPassKind() == PassKind::OwnershipModelEliminator ||
return isMandatory ||
sft->getPassKind() ==
PassKind::NonStdlibNonTransparentFunctionOwnershipModelEliminator;
PassKind::NonTransparentFunctionOwnershipModelEliminator ||
sft->getPassKind() == PassKind::OwnershipModelEliminator;
}

void SILPassManager::runPassOnFunction(unsigned TransIdx, SILFunction *F) {
Expand Down
14 changes: 5 additions & 9 deletions lib/SILOptimizer/PassManager/PassPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ static llvm::cl::opt<bool> SILViewSILGenCFG(
"sil-view-silgen-cfg", llvm::cl::init(false),
llvm::cl::desc("Enable the sil cfg viewer pass before diagnostics"));

static llvm::cl::opt<bool>
SILEnableLateOME("sil-enable-late-ome", llvm::cl::init(false),
llvm::cl::desc("Enable late OwnershipModel elimination"));

//===----------------------------------------------------------------------===//
// Diagnostic Pass Pipeline
//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -382,7 +378,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
P.addDevirtualizer();
P.addARCSequenceOpts();

if (P.getOptions().EnableOSSAModules || SILEnableLateOME) {
if (P.getOptions().EnableOSSAModules) {
// We earlier eliminated ownership if we are not compiling the stdlib. Now
// handle the stdlib functions, re-simplifying, eliminating ARC as we do.
if (!P.getOptions().DisableCopyPropagation) {
Expand All @@ -408,7 +404,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
}

// Clean up Semantic ARC before we perform additional post-inliner opts.
if (P.getOptions().EnableOSSAModules || SILEnableLateOME) {
if (P.getOptions().EnableOSSAModules) {
if (!P.getOptions().DisableCopyPropagation) {
P.addCopyPropagation();
}
Expand Down Expand Up @@ -475,7 +471,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
P.addARCSequenceOpts();

// Run a final round of ARC opts when ownership is enabled.
if (P.getOptions().EnableOSSAModules || SILEnableLateOME) {
if (P.getOptions().EnableOSSAModules) {
if (!P.getOptions().DisableCopyPropagation) {
P.addCopyPropagation();
}
Expand Down Expand Up @@ -532,7 +528,7 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
if (P.getOptions().StopOptimizationBeforeLoweringOwnership)
return;

if (!P.getOptions().EnableOSSAModules && !SILEnableLateOME)
if (!P.getOptions().EnableOSSAModules)
P.addNonTransparentFunctionOwnershipModelEliminator();

// Start by linking in referenced functions from other modules.
Expand Down Expand Up @@ -828,7 +824,7 @@ SILPassPipelinePlan::getPerformancePassPipeline(const SILOptions &Options) {

// Run one last copy propagation/semantic arc opts run before serialization/us
// lowering ownership.
if (P.getOptions().EnableOSSAModules || SILEnableLateOME) {
if (P.getOptions().EnableOSSAModules) {
if (!P.getOptions().DisableCopyPropagation) {
P.addCopyPropagation();
}
Expand Down
13 changes: 0 additions & 13 deletions test/SILOptimizer/ome_ignore_stdlib.sil

This file was deleted.

2 changes: 1 addition & 1 deletion test/SILOptimizer/opaque_values_mandatory.sil
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %target-sil-opt -diagnostics -enable-sil-opaque-values %s | \
// RUN: %target-sil-opt -Onone-performance -enable-sil-verify-all \
// RUN: -enable-sil-opaque-values -emit-sorted-sil \
// RUN: -sil-enable-late-ome -enable-copy-propagation | \
// RUN: -enable-ossa-modules -enable-copy-propagation | \
// RUN: %FileCheck %s

import Builtin
Expand Down
2 changes: 1 addition & 1 deletion test/SILOptimizer/sil_combine_apply_ossa.sil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-sil-opt -sil-enable-late-ome -enable-copy-propagation -enable-sil-verify-all %s -sil-combine -sil-combine-disable-alloc-stack-opts | %FileCheck %s
// RUN: %target-sil-opt -enable-ossa-modules -enable-copy-propagation -enable-sil-verify-all %s -sil-combine -sil-combine-disable-alloc-stack-opts | %FileCheck %s

import Swift
import Builtin
Expand Down