-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
The embedded bitcode should always be prepared for LTO/ThinLTO #133250
base: master
Are you sure you want to change the base?
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
[WIP] The embedded bitcode should always be prepared for LTO/ThinLTO Fixes rust-lang#115344. Fixes rust-lang#117220. r? ghost
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
e91e0c7
to
653500f
Compare
This comment has been minimized.
This comment has been minimized.
653500f
to
fff2da3
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
[WIP] The embedded bitcode should always be prepared for LTO/ThinLTO Fixes rust-lang#115344. Fixes rust-lang#117220. r? ghost
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (5a6a7f3): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.2%, secondary 2.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -1.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary 0.3%, secondary -2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 796.195s -> 796.003s (-0.02%) |
fff2da3
to
807def3
Compare
This PR modifies cc @jieyouxu Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
The embedded bitcode should always be prepared for LTO/ThinLTO Fixes rust-lang#115344. Fixes rust-lang#117220. There are currently two methods for generating bitcode that used for LTO. One method involves using `-C linker-plugin-lto` to emit object files as bitcode, which is the typical setting used by cargo. The other method is through `-C embed-bitcode=yes`. When using with `-C embed-bitcode=yes -C lto=no`, we run a complete non-LTO LLVM pipeline to obtain bitcode, then the bitcode is used for LTO. We run the Call Graph Profile Pass twice on the same module. This PR is doing something similar to LLVM's `buildFatLTODefaultPipeline`, obtaining the bitcode for embedding after running `buildThinLTOPreLinkDefaultPipeline`. r? nikic
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (99acc6a): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.7%, secondary 2.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -1.3%, secondary -1.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary 0.3%, secondary 0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 768.518s -> 768.387s (-0.02%) |
I think this is basically ready for review. Some potential adjustments could be addressed in subsequent PRs:
@rustbot review |
Hmm, when passing |
Two weeks ping |
Two weeks ping again @nikic |
ping |
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.
This generally looks reasonable to me.
Is writing the bitcode out into the incremental directory the usual thing to do, as opposed to keeping it in memory until it is embedded?
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 the changes here also enable --emit=thin-llvm-bc
? If yes, is it stable or unstable?
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 we can only emit it under the -Csave-temps
flag that I haven't implemented yet.
compiler/rustc_session/src/config.rs
Outdated
@@ -508,6 +508,7 @@ impl FromStr for SplitDwarfKind { | |||
pub enum OutputType { | |||
Bitcode, | |||
ThinLinkBitcode, | |||
ThinBitcode, |
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.
Please add doc comments to Bitcode, ThinLinkBitcode and ThinBitcode to explain what the difference between them is...
71873c9
to
d38c420
Compare
I've rebased due to conflicts with #130060.
I can put @rustbot author |
☔ The latest upstream changes (presumably #135335) made this pull request unmergeable. Please resolve the merge conflicts. |
9cb6e23
to
816fc13
Compare
Some changes occurred in compiler/rustc_codegen_gcc |
Sorry for the late update. Pre-linked bitcode no longer needs to be saved to a file now. @rustbot review |
Fixes #115344. Fixes #117220.
There are currently two methods for generating bitcode that used for LTO. One method involves using
-C linker-plugin-lto
to emit object files as bitcode, which is the typical setting used by cargo. The other method is through-C embed-bitcode=yes
.When using with
-C embed-bitcode=yes -C lto=no
, we run a complete non-LTO LLVM pipeline to obtain bitcode, then the bitcode is used for LTO. We run the Call Graph Profile Pass twice on the same module.This PR is doing something similar to LLVM's
buildFatLTODefaultPipeline
, obtaining the bitcode for embedding after runningbuildThinLTOPreLinkDefaultPipeline
.r? nikic