-
Notifications
You must be signed in to change notification settings - Fork 10.5k
cmake: allow building the Swift compiler with Clang's Profile Guided Optimization (PGO) #22073
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
Conversation
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be pretty harmless.
@swift-ci please smoke test |
@swift-ci please smoke test |
@swift-ci please smoke test and merge |
utils/build-script
Outdated
@@ -999,6 +999,9 @@ def main_preset(): | |||
parser.add_argument( | |||
"--build-dir", | |||
help="specify the directory where build artifact should be stored") | |||
parser.add_argument( | |||
"--swift-profile-instr-use", | |||
help="specify the PGO file to use when building swift") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea. Dmitri deliberately made build-script not accept arguments with presets so that people wouldn't end up building the same preset in different configurations. I'm not sure I agree with that principle, but if we really don't like it we should remove the restriction for all arguments, not add individual arguments in one-off places. (The fact that --clang-profile-instr-use
doesn't show up here is telling.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the restriction of adding additional arguments on top of a preset can provide little value. I think you're right that we should therefore allowing all arguments instead of the selected ones. Will fix in another commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was controversial enough at the time Dmitri added it that it's probably worth bringing up on the forums. I'll vote for your change, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i found myself often wanna slightly tweak an existing preset to either debugging or experimenting something, e.g. comparing with/without PGO enabled. Having such restrictions makes it harder IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I am in favor of this, but I think it's worth bringing up with a little more visibility.
@swift-ci please smoke test |
…Optimization (PGO) Previously, Build script flag --clang-profile-instr-use is only used for building clang and llvm. This patch extends PGO to the building of the Swift compiler.
@swift-ci please smoke test and merge |
@swift-ci Please smoke test OS X platform |
Previously, Build script flag --clang-profile-instr-use is only used for building
clang and llvm. This patch extends PGO to the building of the Swift compiler.