Skip to content

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Jan 28, 2022

Internal configurations targeting Darwin employ ThinLTO to
improve compiler performance, however using it on all executable
causes build time to increase with no matching benefit.

To reduce build times in such configurations, we allow some
ancillary targets to opt out of LLVM IR optimizations when linking
ThinLTO with ld64 (e.g. tools used for bootstrapping or debugging the
Swift compiler) -- this behaviour is opt in through a new flag
--swift-tools-ld64-lto-codegen-only-for-supporting-targets.

Addresses rdar://76702687

Internal configurations targeting Darwin employ ThinLTO to
improve compiler performance, however using it on all executable
causes build time to increase with no matching benefit.

To reduce build times in such configurations, we allow some
ancillary targets to opt out of LLVM IR optimizations when linking
ThinLTO with ld64 (e.g. tools used for bootstrapping or debugging the
Swift compiler) -- this behaviour is opt in through a new flag
`--swift-tools-ld64-lto-codegen-only-for-supporting-targets`.

Addresses rdar://76702687
@edymtt
Copy link
Contributor Author

edymtt commented Jan 28, 2022

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Jan 28, 2022

preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto
@swift-ci Please test with preset macOS Platform

@edymtt
Copy link
Contributor Author

edymtt commented Feb 1, 2022

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Feb 1, 2022

preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto
@swift-ci Please test with preset macOS Platform

1 similar comment
@edymtt
Copy link
Contributor Author

edymtt commented Feb 3, 2022

preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto
@swift-ci Please test with preset macOS Platform

@edymtt
Copy link
Contributor Author

edymtt commented Feb 7, 2022

preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto
@swift-ci Please test with preset macOS Platform

@edymtt
Copy link
Contributor Author

edymtt commented Feb 7, 2022

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

If the swift_build_support test actually passes (the string splitting in python is odd), LGTM. Thanks for cleaning this up!

@edymtt
Copy link
Contributor Author

edymtt commented Feb 7, 2022

@swift-ci please python lint

@edymtt
Copy link
Contributor Author

edymtt commented Feb 9, 2022

The build for the preset buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto seems to have issues unrelated to this PR -- Jenkins seems to lose connection to the node while building llvm, probably due to the load caused by building LTO

@edymtt edymtt merged commit f417630 into swiftlang:main Feb 9, 2022
@edymtt edymtt deleted the thinlto-use-codegen-only-in-ld64-for-some-targets branch February 9, 2022 16:32
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