-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Allow to disable thinLTO buffer to support lto-embed-bitcode lld feature #98162
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @lcnr (or someone else) soon. Please see the contribution instructions for more information. |
seems like i missed the notification for this PR 😅 sorry r? rust-lang/compiler |
4cb2088
to
cb61ea9
Compare
This comment has been minimized.
This comment has been minimized.
cb61ea9
to
725971a
Compare
@rustbot label -S-waiting-on-author +S-waiting-on-review |
@rustbot label -S-waiting-on-review +S-waiting-on-author |
725971a
to
d6ac2b6
Compare
This comment has been minimized.
This comment has been minimized.
d6ac2b6
to
87967e8
Compare
@rustbot label -S-waiting-on-author +S-waiting-on-review |
This comment was marked as resolved.
This comment was marked as resolved.
87967e8
to
f9c1459
Compare
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.
Do you think you could add a test case that uses this and -lto-embed-bitcode=optimized
to confirm that it fixes the issue?
src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
28b6f43
to
3858cdd
Compare
@rustbot label -S-waiting-on-author +S-waiting-on-review |
@darkness-ai: 🔑 Insufficient privileges: Not in reviewers |
@bors r+ |
📌 Commit 3858cddaec9a7480b94bfa8432c9ed4df13b0478 has been approved by It is now in the queue for this repository. |
Adding the option to control from rustc CLI if the resulted ".o" bitcode module files are with thinLTO info or regular LTO info. Allows using "-lto-embed-bitcode=optimized" during linkage correctly. Signed-off-by: Ziv Dunkelman <[email protected]>
3858cdd
to
724c912
Compare
@davidtwco saw PRs conflicting with this one got merged into master. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (74f600b): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Hello
This change is to fix issue (#84395) in which passing "-lto-embed-bitcode=optimized" to lld when linking rust code via linker-plugin-lto doesn't produce the expected result.
Instead of emitting a single unified module into a llvmbc section of the linked elf, it emits multiple submodules.
This is caused because rustc emits the BC modules after running llvm
createWriteThinLTOBitcodePass
pass.Which in turn triggers a thinLTO linkage and causes the said issue.
This patch allows via compiler flag (-Cemit-thin-lto=) to select between running
createWriteThinLTOBitcodePass
andcreateBitcodeWriterPass
.Note this pattern of selecting between those 2 passes is common inside of LLVM code.
The default is to match the old behavior.