@@ -347,12 +347,11 @@ void addFunctionPasses(SILPassPipelinePlan &P,
347347 P.addDevirtualizer ();
348348 P.addARCSequenceOpts ();
349349
350- if (! P.getOptions ().SerializeStdlibWithOwnershipWithOpts ) {
350+ if (P.getOptions ().EnableOSSAModules ) {
351351 // We earlier eliminated ownership if we are not compiling the stdlib. Now
352352 // handle the stdlib functions, re-simplifying, eliminating ARC as we do.
353353 P.addCopyPropagation ();
354354 P.addSemanticARCOpts ();
355- P.addNonTransparentFunctionOwnershipModelEliminator ();
356355 }
357356
358357 switch (OpLevel) {
@@ -372,7 +371,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
372371 }
373372
374373 // Clean up Semantic ARC before we perform additional post-inliner opts.
375- if (P.getOptions ().SerializeStdlibWithOwnershipWithOpts ) {
374+ if (P.getOptions ().EnableOSSAModules ) {
376375 P.addCopyPropagation ();
377376 P.addSemanticARCOpts ();
378377 }
@@ -437,7 +436,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
437436 P.addARCSequenceOpts ();
438437
439438 // Run a final round of ARC opts when ownership is enabled.
440- if (P.getOptions ().SerializeStdlibWithOwnershipWithOpts ) {
439+ if (P.getOptions ().EnableOSSAModules ) {
441440 P.addCopyPropagation ();
442441 P.addSemanticARCOpts ();
443442 }
@@ -490,7 +489,8 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
490489 if (P.getOptions ().StopOptimizationBeforeLoweringOwnership )
491490 return ;
492491
493- P.addNonStdlibNonTransparentFunctionOwnershipModelEliminator ();
492+ if (!P.getOptions ().EnableOSSAModules )
493+ P.addNonTransparentFunctionOwnershipModelEliminator ();
494494
495495 // Start by linking in referenced functions from other modules.
496496 P.addPerformanceSILLinker ();
@@ -778,15 +778,13 @@ SILPassPipelinePlan::getPerformancePassPipeline(const SILOptions &Options) {
778778 //
779779 // FIXME: When *not* emitting a .swiftmodule, skip the high-level function
780780 // pipeline to save compile time.
781- //
782- // NOTE: Ownership is now stripped within this function for the stdlib.
783781 addHighLevelFunctionPipeline (P);
784782
785783 addHighLevelModulePipeline (P);
786784
787785 // Run one last copy propagation/semantic arc opts run before serialization/us
788786 // lowering ownership.
789- if (P.getOptions ().SerializeStdlibWithOwnershipWithOpts ) {
787+ if (P.getOptions ().EnableOSSAModules ) {
790788 P.addCopyPropagation ();
791789 P.addSemanticARCOpts ();
792790 }
0 commit comments