Skip to content

Commit ade59f3

Browse files
authored
Merge pull request #39594 from meg-gupta/removeredflag
Remove redundant flag -sil-enable-late-ome now that -enable-ossa-modules has been fixed
2 parents 2335116 + 2d7e20e commit ade59f3

File tree

7 files changed

+10
-37
lines changed

7 files changed

+10
-37
lines changed

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,6 @@ PASS(NestedSemanticFunctionCheck, "nested-semantic-function-check",
315315
PASS(NonTransparentFunctionOwnershipModelEliminator,
316316
"non-transparent-func-ownership-model-eliminator",
317317
"Eliminate Ownership Annotations from non-transparent SIL Functions")
318-
PASS(NonStdlibNonTransparentFunctionOwnershipModelEliminator,
319-
"non-stdlib-non-transparent-func-ownership-model-eliminator",
320-
"Eliminate Ownership Annotations from non-transparent SIL Functions only when not processing the stdlib.")
321318
PASS(RCIdentityDumper, "rc-id-dumper",
322319
"Print Reference Count Identities")
323320
PASS(AlwaysInlineInliner, "always-inline",

lib/SILOptimizer/Mandatory/OwnershipModelEliminator.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,3 @@ SILTransform *swift::createNonTransparentFunctionOwnershipModelEliminator() {
651651
return new OwnershipModelEliminator(true /*skip transparent*/,
652652
false /*ignore stdlib*/);
653653
}
654-
655-
SILTransform *
656-
swift::createNonStdlibNonTransparentFunctionOwnershipModelEliminator() {
657-
return new OwnershipModelEliminator(true /*skip transparent*/,
658-
true /*ignore stdlib*/);
659-
}

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,10 @@ void SILPassManager::dumpPassInfo(const char *Title, unsigned TransIdx,
392392
}
393393

394394
bool SILPassManager::isMandatoryFunctionPass(SILFunctionTransform *sft) {
395-
return isMandatory || sft->getPassKind() ==
396-
PassKind::NonTransparentFunctionOwnershipModelEliminator ||
397-
sft->getPassKind() == PassKind::OwnershipModelEliminator ||
395+
return isMandatory ||
398396
sft->getPassKind() ==
399-
PassKind::NonStdlibNonTransparentFunctionOwnershipModelEliminator;
397+
PassKind::NonTransparentFunctionOwnershipModelEliminator ||
398+
sft->getPassKind() == PassKind::OwnershipModelEliminator;
400399
}
401400

402401
void SILPassManager::runPassOnFunction(unsigned TransIdx, SILFunction *F) {

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ static llvm::cl::opt<bool> SILViewSILGenCFG(
5555
"sil-view-silgen-cfg", llvm::cl::init(false),
5656
llvm::cl::desc("Enable the sil cfg viewer pass before diagnostics"));
5757

58-
static llvm::cl::opt<bool>
59-
SILEnableLateOME("sil-enable-late-ome", llvm::cl::init(false),
60-
llvm::cl::desc("Enable late OwnershipModel elimination"));
61-
6258
//===----------------------------------------------------------------------===//
6359
// Diagnostic Pass Pipeline
6460
//===----------------------------------------------------------------------===//
@@ -382,7 +378,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
382378
P.addDevirtualizer();
383379
P.addARCSequenceOpts();
384380

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

410406
// Clean up Semantic ARC before we perform additional post-inliner opts.
411-
if (P.getOptions().EnableOSSAModules || SILEnableLateOME) {
407+
if (P.getOptions().EnableOSSAModules) {
412408
if (!P.getOptions().DisableCopyPropagation) {
413409
P.addCopyPropagation();
414410
}
@@ -475,7 +471,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
475471
P.addARCSequenceOpts();
476472

477473
// Run a final round of ARC opts when ownership is enabled.
478-
if (P.getOptions().EnableOSSAModules || SILEnableLateOME) {
474+
if (P.getOptions().EnableOSSAModules) {
479475
if (!P.getOptions().DisableCopyPropagation) {
480476
P.addCopyPropagation();
481477
}
@@ -532,7 +528,7 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
532528
if (P.getOptions().StopOptimizationBeforeLoweringOwnership)
533529
return;
534530

535-
if (!P.getOptions().EnableOSSAModules && !SILEnableLateOME)
531+
if (!P.getOptions().EnableOSSAModules)
536532
P.addNonTransparentFunctionOwnershipModelEliminator();
537533

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

829825
// Run one last copy propagation/semantic arc opts run before serialization/us
830826
// lowering ownership.
831-
if (P.getOptions().EnableOSSAModules || SILEnableLateOME) {
827+
if (P.getOptions().EnableOSSAModules) {
832828
if (!P.getOptions().DisableCopyPropagation) {
833829
P.addCopyPropagation();
834830
}

test/SILOptimizer/ome_ignore_stdlib.sil

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

test/SILOptimizer/opaque_values_mandatory.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-sil-opt -diagnostics -enable-sil-opaque-values %s | \
22
// RUN: %target-sil-opt -Onone-performance -enable-sil-verify-all \
33
// RUN: -enable-sil-opaque-values -emit-sorted-sil \
4-
// RUN: -sil-enable-late-ome -enable-copy-propagation | \
4+
// RUN: -enable-ossa-modules -enable-copy-propagation | \
55
// RUN: %FileCheck %s
66

77
import Builtin

test/SILOptimizer/sil_combine_apply_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 -sil-enable-late-ome -enable-copy-propagation -enable-sil-verify-all %s -sil-combine -sil-combine-disable-alloc-stack-opts | %FileCheck %s
1+
// 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
22

33
import Swift
44
import Builtin

0 commit comments

Comments
 (0)