Skip to content

Commit 7d9ec8d

Browse files
committed
[semantic-arc-opts] Make sure to only run this pass when optimization is enabled even though it is running during the mandatory passes (for now).
The idea is that eventually down the line we will split this pass into a mandatory/performance parts once ownership SSA is eliminated after the guaranteed passes run. For now though, just run this when optimization is enabled. This pass only runs on the stdlib/overlays so far so there shouldn't have been any slow downs in non-stdlib -Onone builds.
1 parent 51bf7cc commit 7d9ec8d

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)