Skip to content

Commit cb20bf3

Browse files
authored
Merge pull request swiftlang#21364 from gottesmm/pr-b72f035964186b8844785fa3c3c0566fff73f814
2 parents 9c12fd1 + 7d9ec8d commit cb20bf3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,14 @@ static void addMandatoryOptPipeline(SILPassPipelinePlan &P,
9292
P.addAllocBoxToStack();
9393
P.addNoReturnFolding();
9494
addDefiniteInitialization(P);
95-
if (Options.EnableMandatorySemanticARCOpts) {
95+
// Only run semantic arc opts if we are optimizing and if mandatory semantic
96+
// arc opts is explicitly enabled.
97+
//
98+
// NOTE: Eventually this pass will be split into a mandatory/more aggressive
99+
// pass. This will happen when OSSA is no longer eliminated before the
100+
// optimizer pipeline is run implying we can put a pass that requires OSSA
101+
// there.
102+
if (Options.EnableMandatorySemanticARCOpts && Options.shouldOptimize()) {
96103
P.addSemanticARCOpts();
97104
}
98105
P.addClosureLifetimeFixup();

0 commit comments

Comments
 (0)