@@ -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." ));
@@ -452,16 +446,6 @@ void addFunctionPasses(SILPassPipelinePlan &P,
452
446
// Cleanup, which is important if the inliner has restarted the pass pipeline.
453
447
P.addPerformanceConstantPropagation ();
454
448
455
- if (!P.getOptions ().EnableOSSAModules && !SILDisableLateOMEByDefault) {
456
- if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
457
- return ;
458
-
459
- if (SILPrintFinalOSSAModule) {
460
- addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
461
- }
462
- P.addNonTransparentFunctionOwnershipModelEliminator ();
463
- }
464
-
465
449
addSimplifyCFGSILCombinePasses (P);
466
450
467
451
P.addArrayElementPropagation ();
@@ -506,13 +490,21 @@ void addFunctionPasses(SILPassPipelinePlan &P,
506
490
}
507
491
P.addARCSequenceOpts ();
508
492
509
- if (P.getOptions ().EnableOSSAModules ) {
510
- // We earlier eliminated ownership if we are not compiling the stdlib. Now
511
- // handle the stdlib functions, re-simplifying, eliminating ARC as we do.
512
- if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off) {
513
- P.addCopyPropagation ();
493
+ // We earlier eliminated ownership if we are not compiling the stdlib. Now
494
+ // handle the stdlib functions, re-simplifying, eliminating ARC as we do.
495
+ if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off) {
496
+ P.addCopyPropagation ();
497
+ }
498
+ P.addSemanticARCOpts ();
499
+
500
+ if (!P.getOptions ().EnableOSSAModules ) {
501
+ if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
502
+ return ;
503
+
504
+ if (SILPrintFinalOSSAModule) {
505
+ addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
514
506
}
515
- P.addSemanticARCOpts ();
507
+ P.addNonTransparentFunctionOwnershipModelEliminator ();
516
508
}
517
509
518
510
switch (OpLevel) {
@@ -641,16 +633,6 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
641
633
// not blocked by any other passes' optimizations, so do it early.
642
634
P.addDifferentiabilityWitnessDevirtualizer ();
643
635
644
- if (!P.getOptions ().EnableOSSAModules && SILDisableLateOMEByDefault) {
645
- if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
646
- return ;
647
-
648
- if (SILPrintFinalOSSAModule) {
649
- addModulePrinterPipeline (P, " SIL Print Final OSSA Module" );
650
- }
651
- P.addNonTransparentFunctionOwnershipModelEliminator ();
652
- }
653
-
654
636
// Start by linking in referenced functions from other modules.
655
637
P.addPerformanceSILLinker ();
656
638
0 commit comments