@@ -61,12 +61,6 @@ static llvm::cl::opt<bool> SILViewSILGenCFG(
61
61
" sil-view-silgen-cfg" , llvm::cl::init(false ),
62
62
llvm::cl::desc(" Enable the sil cfg viewer pass before diagnostics" ));
63
63
64
-
65
- llvm::cl::opt<bool > SILDisableLateOMEByDefault (
66
- " sil-disable-late-ome-by-default" , llvm::cl::init(false ),
67
- llvm::cl::desc(
68
- " Disable late OME for non-transparent functions by default" ));
69
-
70
64
llvm::cl::opt<bool >
71
65
EnableDestroyHoisting (" enable-destroy-hoisting" , llvm::cl::init(false ),
72
66
llvm::cl::desc(" Enable the DestroyHoisting pass." ));
@@ -427,16 +421,6 @@ void addFunctionPasses(SILPassPipelinePlan &P,
427
421
// Cleanup, which is important if the inliner has restarted the pass pipeline.
428
422
P.addPerformanceConstantPropagation ();
429
423
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
424
addSimplifyCFGSILCombinePasses (P);
441
425
442
426
P.addArrayElementPropagation ();
@@ -481,13 +465,21 @@ void addFunctionPasses(SILPassPipelinePlan &P,
481
465
}
482
466
P.addARCSequenceOpts ();
483
467
484
- if (P.getOptions ().EnableOSSAModules ) {
485
- // We earlier eliminated ownership if we are not compiling the stdlib. Now
486
- // handle the stdlib functions, re-simplifying, eliminating ARC as we do.
487
- if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off) {
488
- P.addCopyPropagation ();
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 ();
472
+ }
473
+ P.addSemanticARCOpts ();
474
+
475
+ if (!P.getOptions ().EnableOSSAModules ) {
476
+ if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
477
+ return ;
478
+
479
+ if (SILPrintFinalOSSAModule) {
480
+ addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
489
481
}
490
- P.addSemanticARCOpts ();
482
+ P.addNonTransparentFunctionOwnershipModelEliminator ();
491
483
}
492
484
493
485
switch (OpLevel) {
@@ -616,16 +608,6 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
616
608
// not blocked by any other passes' optimizations, so do it early.
617
609
P.addDifferentiabilityWitnessDevirtualizer ();
618
610
619
- if (!P.getOptions ().EnableOSSAModules && SILDisableLateOMEByDefault) {
620
- if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
621
- return ;
622
-
623
- if (SILPrintFinalOSSAModule) {
624
- addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
625
- }
626
- P.addNonTransparentFunctionOwnershipModelEliminator ();
627
- }
628
-
629
611
// Start by linking in referenced functions from other modules.
630
612
P.addPerformanceSILLinker ();
631
613
0 commit comments