@@ -194,10 +194,10 @@ static void addMandatoryDiagnosticOptPipeline(SILPassPipelinePlan &P) {
194194
195195 // Only issue weak lifetime warnings for users who select object lifetime
196196 // optimization. The risk of spurious warnings outweighs the benefits.
197- if (P.getOptions ().EnableCopyPropagation ) {
197+ if (P.getOptions ().CopyPropagation == CopyPropagationOption::On ) {
198198 P.addDiagnoseLifetimeIssues ();
199199 }
200-
200+
201201 P.addGlobalOpt ();
202202 P.addPerformanceDiagnostics ();
203203
@@ -412,7 +412,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
412412 if (P.getOptions ().EnableOSSAModules ) {
413413 // We earlier eliminated ownership if we are not compiling the stdlib. Now
414414 // handle the stdlib functions, re-simplifying, eliminating ARC as we do.
415- if (! P.getOptions ().DisableCopyPropagation ) {
415+ if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off ) {
416416 P.addCopyPropagation ();
417417 }
418418 P.addSemanticARCOpts ();
@@ -436,7 +436,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
436436
437437 // Clean up Semantic ARC before we perform additional post-inliner opts.
438438 if (P.getOptions ().EnableOSSAModules ) {
439- if (! P.getOptions ().DisableCopyPropagation ) {
439+ if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off ) {
440440 P.addCopyPropagation ();
441441 }
442442 P.addSemanticARCOpts ();
@@ -503,7 +503,7 @@ void addFunctionPasses(SILPassPipelinePlan &P,
503503
504504 // Run a final round of ARC opts when ownership is enabled.
505505 if (P.getOptions ().EnableOSSAModules ) {
506- if (! P.getOptions ().DisableCopyPropagation ) {
506+ if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off ) {
507507 P.addCopyPropagation ();
508508 }
509509 P.addSemanticARCOpts ();
@@ -539,7 +539,7 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) {
539539 // Cleanup after SILGen: remove trivial copies to temporaries.
540540 P.addTempRValueOpt ();
541541 // Cleanup after SILGen: remove unneeded borrows/copies.
542- if (P.getOptions ().EnableCopyPropagation ) {
542+ if (P.getOptions ().CopyPropagation == CopyPropagationOption::On ) {
543543 P.addCopyPropagation ();
544544 }
545545 P.addSemanticARCOpts ();
@@ -863,7 +863,7 @@ SILPassPipelinePlan::getPerformancePassPipeline(const SILOptions &Options) {
863863 // Run one last copy propagation/semantic arc opts run before serialization/us
864864 // lowering ownership.
865865 if (P.getOptions ().EnableOSSAModules ) {
866- if (! P.getOptions ().DisableCopyPropagation ) {
866+ if (P.getOptions ().CopyPropagation != CopyPropagationOption::Off ) {
867867 P.addCopyPropagation ();
868868 }
869869 P.addSemanticARCOpts ();
@@ -915,7 +915,7 @@ SILPassPipelinePlan::getOnonePassPipeline(const SILOptions &Options) {
915915 P.startPipeline (" non-Diagnostic Enabling Mandatory Optimizations" );
916916 P.addForEachLoopUnroll ();
917917 P.addMandatoryCombine ();
918- if (P.getOptions ().EnableCopyPropagation ) {
918+ if (P.getOptions ().CopyPropagation == CopyPropagationOption::On ) {
919919 // MandatoryCopyPropagation should only be run at -Onone, not -O.
920920 P.addMandatoryCopyPropagation ();
921921 }
0 commit comments