Skip to content

Pass -enable-cmo-everything to frontend jobs #1663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

tshortli
Copy link
Contributor

Pass the -enable-cmo-everything flag down to frontend jobs and suppress -enable-default-cmo when we do, just like with -cross-module-optimization.

Additional drive-by fixes:

  • Bring Options.swift up-to-date.
  • Pass the new -warn-soft-deprecated flag through to frontend jobs.

Resolves rdar://128401284.

@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli
Copy link
Contributor Author

@swift-ci please test macOS

@@ -370,6 +371,7 @@ extension Driver {

try commandLine.appendLast(.trackSystemDependencies, from: &parsedOptions)
try commandLine.appendLast(.CrossModuleOptimization, from: &parsedOptions)
try commandLine.appendLast(.EnableCMOEverything, from: &parsedOptions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to handle if any combination of -cross-module-optimization, -enable-default-cmo and -enable-cmo-everything is passed that the more aggressive one wins or does swiftc already handle that?

Copy link
Contributor Author

@tshortli tshortli Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend has logic for choosing the single level of optimization based on the presence of conflicting flags. It works a bit differently than I would expect; I think a more standard way to handle that would be to use whichever of the three flags comes last on the command line, but there is at least a strategy for resolving conflicts.

@tshortli tshortli merged commit f2522c6 into swiftlang:main Jul 15, 2024
3 checks passed
@tshortli tshortli deleted the enable-cmo-everything branch July 15, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants