Skip to content

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

Merged
merged 1 commit into from
Jan 24, 2019

Conversation

nkcsgexi
Copy link
Contributor

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.

@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Member

@compnerd compnerd left a 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.

@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test

@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test and merge

@@ -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")
Copy link
Contributor

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.)

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

@nkcsgexi
Copy link
Contributor Author

@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.
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test and merge

@nkcsgexi
Copy link
Contributor Author

@swift-ci Please smoke test OS X platform

@nkcsgexi nkcsgexi merged commit ff0d764 into swiftlang:master Jan 24, 2019
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.

4 participants