-
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
Encode only MIR reachable from other crates #115306
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 7a2b2ca0a9f3c45e766138547f81d4a130ba09d4 with merge 524a72e9fbc25be53b017952c3f2520a769c65c0... |
7a2b2ca
to
18f8aa6
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 18f8aa6acb7bdb7bbee9ddd47b74d6453c879a08 with merge 8befefe0eeb75ffb3138d26537e90703d068ea2a... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@rust-timer build 524a72e9fbc25be53b017952c3f2520a769c65c0 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (524a72e9fbc25be53b017952c3f2520a769c65c0): comparison URL. Overall result: ❌✅ regressions and improvements - 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. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @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: 631.418s -> 630.932s (-0.08%) |
18f8aa6
to
945cde2
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 945cde202a1018cf8f93fea755db3da165f355bc with merge 69b9a1d784d7997066edd67bfea933c18927502e... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
@@ -1580,9 +1585,10 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { | |||
} | |||
|
|||
let tcx = self.tcx; | |||
let reachable_set = tcx.reachable_set(()); | |||
|
|||
let keys_and_jobs = tcx.mir_keys(()).iter().filter_map(|&def_id| { |
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.
Should we filter more aggressively using a .filter(|def_id| reachable_set.contains(def_id))
?
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.
reachable_set is used to filter the optimized MIR only. It might still be necessary to encode MIR for CTFE.
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.
That's my question: should we filter MIR for CTFE too according to the same rule?
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.
The reachable set cannot be used for the purpose. It contains items externally reachable in the linkage sense, or that could be code generated while building other crates, but it doesn't have much to say about items which might evaluated in other crates. Implementing this would require a separate analysis (I assume we don't want to include those in reachable set since that would be pessimization).
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.
Could you add a line explaining the logic around reachable_set
and this exception to the doc-comment on should_encode_mir
?
r=me then
b5b696c
to
77bde92
Compare
This comment has been minimized.
This comment has been minimized.
Only reachable items might participate in the code generation in the downstream crates. Omit redundant optimized MIR of unreachable items from a crate metadata. Additionally, include reachable closures in reachable set, so that unreachable closures can be omitted on the same basis.
77bde92
to
d99333e
Compare
@bors r=cjgillot |
…llot Encode only MIR reachable from other crates Only reachable items might participate in the code generation in the downstream crates. Omit redundant optimized MIR of unreachable items from a crate metadata. Additionally, include reachable closures in reachable set, so that unreachable closures can be omitted on the same basis.
☀️ Test successful - checks-actions |
👀 Test was successful, but fast-forwarding failed: 422 Update is not a fast forward |
@bors retry |
Finished benchmarking commit (65b2ffd): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression 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: 629.364s -> 629.035s (-0.05%) |
☀️ Test successful - checks-actions |
Finished benchmarking commit (7418413): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression 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: 631.343s -> 629.704s (-0.26%) |
@rustbot label: +perf-regression-triaged |
Only reachable items might participate in the code generation in the
downstream crates. Omit redundant optimized MIR of unreachable items
from a crate metadata.
Additionally, include reachable closures in reachable set, so that
unreachable closures can be omitted on the same basis.