@@ -427,16 +427,6 @@ void addFunctionPasses(SILPassPipelinePlan &P,
427
427
// Cleanup, which is important if the inliner has restarted the pass pipeline.
428
428
P.addPerformanceConstantPropagation ();
429
429
430
- if (!P.getOptions ().EnableOSSAModules && !SILDisableLateOMEByDefault) {
431
- if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
432
- return ;
433
-
434
- if (SILPrintFinalOSSAModule) {
435
- addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
436
- }
437
- P.addNonTransparentFunctionOwnershipModelEliminator ();
438
- }
439
-
440
430
addSimplifyCFGSILCombinePasses (P);
441
431
442
432
P.addArrayElementPropagation ();
@@ -475,14 +465,20 @@ void addFunctionPasses(SILPassPipelinePlan &P,
475
465
P.addDevirtualizer ();
476
466
P.addARCSequenceOpts ();
477
467
478
- if (P.getOptions ().EnableOSSAModules ) {
479
- // We earlier eliminated ownership if we are not compiling the stdlib. Now
480
- // handle the stdlib functions, re-simplifying, eliminating ARC as we do.
481
- if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off) {
482
- P.addCopyPropagation ();
483
- }
484
- P.addSemanticARCOpts ();
468
+ // We earlier eliminated ownership if we are not compiling the stdlib. Now
469
+ // handle the stdlib functions, re-simplifying, eliminating ARC as we do.
470
+ if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off) {
471
+ P.addCopyPropagation ();
485
472
}
473
+ P.addSemanticARCOpts ();
474
+
475
+ if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
476
+ return ;
477
+
478
+ if (SILPrintFinalOSSAModule) {
479
+ addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
480
+ }
481
+ P.addNonTransparentFunctionOwnershipModelEliminator ();
486
482
487
483
switch (OpLevel) {
488
484
case OptimizationLevelKind::HighLevel:
@@ -610,16 +606,6 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
610
606
// not blocked by any other passes' optimizations, so do it early.
611
607
P.addDifferentiabilityWitnessDevirtualizer ();
612
608
613
- if (!P.getOptions ().EnableOSSAModules && SILDisableLateOMEByDefault) {
614
- if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
615
- return ;
616
-
617
- if (SILPrintFinalOSSAModule) {
618
- addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
619
- }
620
- P.addNonTransparentFunctionOwnershipModelEliminator ();
621
- }
622
-
623
609
// Start by linking in referenced functions from other modules.
624
610
P.addPerformanceSILLinker ();
625
611
0 commit comments