-
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
Remove GenKillAnalysis
#131481
Remove GenKillAnalysis
#131481
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Remove `GenKillAnalysis` r? `@ghost`
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (690cb9f): 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 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 -3.0%, secondary 1.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.
CyclesResults (primary -1.0%, secondary -0.7%)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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 775.903s -> 772.537s (-0.43%) |
5639840
to
28b7c57
Compare
I was hoping for neutral performance effects, but the perf run is much better than that: icount results are great, cycles results are good, bootstrap time drops by 3.4s, and artifact size drops by 228 KiB. |
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
cc @cjgillot |
IIRC, the |
//! To use this framework, implement the [`Analysis`] trait. There used to be a `GenKillAnalysis` | ||
//! alternative trait intended as an optimzation, but it ended up not being any faster than | ||
//! `Analysis`. `impls` module contains several examples of dataflow analyses. |
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.
GenKillAnalysis
will be unfamiliar to future readers. Can you describe that the main idea was to pre-compute transfer function for each block or omit the historical comment altogether.
I am in favor of removing the LGTM. r? cjgillot |
I'm no expert on the analyses, but I do have pretty high confidence in the coverage of our test suite, such that any degenerate cases are likely to be very rare. Also, it's interesting that the largest wins were in the secondary benchmarks such as |
It's hardly worth it, and it needs to be removed so that `GenKillAnalysis` can be removed.
This is an alternative to `Engine::new_generic` for gen/kill analyses. It's supposed to be an optimization, but it has negligible effect. The commit merges `Engine::new_generic` into `Engine::new`. This allows the removal of various other things: `GenKillSet`, `gen_kill_statement_effects_in_block`, `is_cfg_cyclic`.
`GenKillAnalysis` has very similar methods to `Analysis`, but the first two have a notable difference: the second argument is `&mut impl GenKill<Self::Idx>` instead of `&mut Self::Domain`. But thanks to the previous commit, this difference is no longer necessary.
Thanks to the previous couple of commits, many uses of the `GenKill` trait can be replaced with a concrete type.
It's now functionally identical to `Analysis`.
With `GenKillAnalysis` gone, there is no need for them to be separate.
…ct}`. To avoid some low-value boilerplate code.
28b7c57
to
33abf6a
Compare
I don't have the same confidence in the test suite, but I don't have any argument besides "may". |
Remove `GenKillAnalysis` There are two kinds of dataflow analysis in the compiler: `Analysis`, which is the basic kind, and `GenKillAnalysis`, which is a more specialized kind for gen/kill analyses that is intended as an optimization. However, it turns out that `GenKillAnalysis` is actually a pessimization! It's faster (and much simpler) to do all the gen/kill analyses via `Analysis`. This lets us remove `GenKillAnalysis`, and `GenKillSet`, and a few other things, and also merge `AnalysisDomain` into `Analysis`. The PR removes 500 lines of code and improves performance. r? `@tmiasko`
💔 Test failed - checks-actions |
@bors retry |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (d829780): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression 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 3.1%, secondary 0.6%)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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 781.797s -> 780.385s (-0.18%) |
Update Rust toolchain to 2024-10-17. The changes required are due to the merging of `AnalysisDomain` into `Analysis`: rust-lang/rust#131481 Resolves #3608 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
Remove `GenKillAnalysis` There are two kinds of dataflow analysis in the compiler: `Analysis`, which is the basic kind, and `GenKillAnalysis`, which is a more specialized kind for gen/kill analyses that is intended as an optimization. However, it turns out that `GenKillAnalysis` is actually a pessimization! It's faster (and much simpler) to do all the gen/kill analyses via `Analysis`. This lets us remove `GenKillAnalysis`, and `GenKillSet`, and a few other things, and also merge `AnalysisDomain` into `Analysis`. The PR removes 500 lines of code and improves performance. r? `@tmiasko`
…aflow-cleanups, r=<try> Still more `rustc_mir_dataflow` cleanups A sequel to rust-lang#118203, rust-lang#118230, rust-lang#118638, and rust-lang#131481. I'm pleased with this PR. It cleans up a few things that have been bugging me for a while. It took quite some effort to find these improvements. r? `@cjgillot`
There are two kinds of dataflow analysis in the compiler:
Analysis
, which is the basic kind, andGenKillAnalysis
, which is a more specialized kind for gen/kill analyses that is intended as an optimization. However, it turns out thatGenKillAnalysis
is actually a pessimization! It's faster (and much simpler) to do all the gen/kill analyses viaAnalysis
. This lets us removeGenKillAnalysis
, andGenKillSet
, and a few other things, and also mergeAnalysisDomain
intoAnalysis
. The PR removes 500 lines of code and improves performance.r? @tmiasko