-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 |
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 focuses on the no-lto case, but don't we currently also embed post-link bitcode when using thin-local?
I'm a bit concerned that this is implemented by running by module cloning and a separate optimization pipeline. This is slow and cloning has correctness issues (though I think they're blockaddress related, so currently not relevant for Rust). The way LLVM itself does this (see buildFatLTODefaultPipeline) is to embed the bitcode post-ThinLTOPreLink and then run ModuleOptimization (on the same module) before codegen.
b31f4ed
to
115e7a7
Compare
This comment has been minimized.
This comment has been minimized.
115e7a7
to
a6277ec
Compare
a6277ec
to
581462d
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
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