-
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
Increase the precision of the exportable MIR check #112511
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 06f0db5a78133b5791bff0a1aaf4d40adedf3577 with merge 7b33b2e034f6752ed454835d2b617f567fda33b6... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
d790b8f
to
0314140
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 0314140fbbb7d2ca96f10b98e46fe31a4b90c87d with merge 74dba061b486ec4270e8845fbaa787be765c8c7b... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
0314140
to
622821a
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…=<try> Increase the precision of the exportable MIR check r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
I think all the regressions are because this PR enables MIR inlining in all debug builds. All the regressions already produce the same error or ICE with Which now come to think of it is what I should have asked crater to do, but I was afraid of the run taking too long. That train has sailed. |
67532bb
to
433b1bb
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 433b1bb with merge aca4559513bf32802e55bdc4f193dff6cdb1e19b... |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (aca4559513bf32802e55bdc4f193dff6cdb1e19b): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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 sizeResultsThis 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: 659.628s -> 665.008s (0.82%) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
IIUC, the goal of this PR is to encore promoted_mir, in case we inline a body which references a promoted constant. Instead of relying on a global inlined_internal_defs, can this be performed by walking |
Can you describe why would it ever be necessary to encode additional promoteds and give an example? The Also, please take a look at |
☔ The latest upstream changes (presumably #113105) made this pull request unmergeable. Please resolve the merge conflicts. |
@tmiasko I think the problem you're trying to point me at is with the implementation of Because
which is in turn based on reachable_set :rust/compiler/rustc_codegen_ssa/src/back/symbol_export.rs Lines 60 to 61 in f20afcc
So I'm trying to reimplement rust/compiler/rustc_passes/src/reachable.rs Lines 396 to 409 in f20afcc
I'm not asking for help, just offering up my state so people know this is still in-progress, and in case something I'm saying seems quite wrong. You and others here know much more about the compiler than I do. |
The approach suggested in the fixme regarding reachability for trait impl methods seems plausible in principle. Vtable methods are also reachable from a code that constructs vtable even if respective methods are never called. Hard to say whether this list is exhaustive. |
ping from triage - can you post your status on this PR? There hasn't been an update in a few months. Thanks! |
Yes. I'm closing this PR because the work that's described in these PR comments is actually in a different branch of mine. If I make progress on this whole concept, it will be by landing that branch first, then re-pursuing this idea. |
Before this PR, MIR inlining only inlines across crates or within a crate if the callee is a constructor,
#[inline]
, or generic. This misses some inlining opportunities within a crate; trivial helper functions are not always given#[inline]
(and maybe that's a good thing).The reason we were so conservative before is that the MIR inliner needs to not drag MIR which mentions items that we did not generate MIR for, or items that we have given internal linkage, into bodies that we must generate MIR for. If we get this heuristic wrong, we see ICEs (for promoted consts without MIR) or linker errors (for private functions and statics now mentioned in exported MIR). So this PR adds more fine-grained analysis to detect callee bodies that contain MIR we must not export.
Perhaps even better, this PR removes any prohibition on inlining not-exported bodies into other not-exported bodies.