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