-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Run base::internalize_symbols() even for single-codegen-unit crates. #34899
Run base::internalize_symbols() even for single-codegen-unit crates. #34899
Conversation
The initial linkage-assignment (especially for closures) is a conservative one that makes some symbols more visible than they need to be. While this is not a correctness problem, it does force the LLVM inliner to be more conservative too, which results in poor performance. Once translation is based solely on MIR, it will be easier to also make the initial linkage assignment a better fitting one. Until then `internalize_symbols()` does a good job of preventing most performance regressions.
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit 22f77a9 has been approved by |
@michaelwoerister I would expect #34831 to be fixed by this, not necessarily #34891. |
…=eddyb Run base::internalize_symbols() even for single-codegen-unit crates. The initial linkage-assignment (especially for closures) is a conservative one that makes some symbols more visible than they need to be. While this is not a correctness problem, it does force the LLVM inliner to be more conservative too, which results in poor performance. Once translation is based solely on MIR, it will be easier to also make the initial linkage assignment a better fitting one. Until then `internalize_symbols()` does a good job of preventing most performance regressions. This should solve the regressions reported in #34891 and maybe also those in #34831. As a side-effect, this will also solve most of the problematic cases described in #34793. Not reliably so, however. For that, we still need a solution like the one implement in #34830. cc @rust-lang/compiler
It seems it did mess up something with a last minute refactoring rust/src/librustc_trans/base.rs Line 2289 in 8052f73
|
Fix wrong condition in base::internalize_symbols(). Fix a typo that snuck into #34899 (and completely broke `internalize_symbols()`).
The initial linkage-assignment (especially for closures) is a conservative one that makes some symbols more visible than they need to be. While this is not a correctness problem, it does force the LLVM inliner to be more conservative too, which results in poor performance. Once translation is based solely on MIR, it will be easier to also make the initial linkage assignment a better fitting one. Until then
internalize_symbols()
does a good job of preventing most performance regressions.This should solve the regressions reported in #34891 and maybe also those in #34831.
As a side-effect, this will also solve most of the problematic cases described in #34793. Not reliably so, however. For that, we still need a solution like the one implement in #34830.
cc @rust-lang/compiler