Uh oh!
There was an error while loading. Please reload this page.
A single framework for gen-kill and generic dataflow problems - #65672
Conversation
bors
commented
Oct 27, 2019
☔ The latest upstream changes (presumably #65869) made this pull request unmergeable. Please resolve the merge conflicts. |
JohnCSimon
commented
Nov 2, 2019
Ping from triage: |
JohnCSimon
commented
Nov 9, 2019
Pinging from triage: |
e7116e1 to
97b88ddCompareThis was discussed in the design meeting on Nov. 8 (rust-lang/compiler-team#202). The consensus was to move forward on a design similar to the prototype. I'll be actively working to finish this, hopefully with some input from the compiler team. |
d6c3959 to
df0d51bCompare9ce9240 to
75775baCompareecstatic-morse
commented
Nov 14, 2019
@bors try @rust-timer queue |
rust-timer
commented
Nov 14, 2019
Awaiting bors try build completion |
bors
commented
Nov 14, 2019
[WIP] A single framework for gen-kill and generic dataflow problems This is the prototype implementation discussed in rust-lang/compiler-team#202. You can read a high-level description of it in [the proposal](https://hackmd.io/@39Qr_z9cQhasi25sGjmFnA/Skvd9rztS) for that design meeting. This would eventually supersede the existing `BitDenotation` interface. r? @ghost cc @rust-lang/compiler (esp. @eddyb and @pnkfelix)
bors
commented
Nov 14, 2019
☀️ Try build successful - checks-azure |
rust-timer
commented
Nov 14, 2019
Queued 1e0b457 with parent 3f07f1c, future comparison URL. |
rust-timer
commented
Nov 14, 2019
Finished benchmarking try commit 1e0b457, comparison URL. |
Okay, this now converts a commonly used dataflow analysis, I've triggered a perf run and the results look okay except for a slight regression in r? @pnkfelix cc @rust-lang/compiler (feel free to reassign) Here are the unresolved "details" questions from the design meeting that are pertinent to this PR along with my thoughts on each. We should resolve these questions before merging.
|
75775ba to
c4cda32Compareecstatic-morse
commented
Nov 15, 2019
@bors try @rust-timer queue |
rust-timer
commented
Nov 15, 2019
Awaiting bors try build completion |
bors
commented
Nov 15, 2019
[WIP] A single framework for gen-kill and generic dataflow problems This is the prototype implementation discussed in rust-lang/compiler-team#202. You can read a high-level description of it in [the proposal](https://hackmd.io/@39Qr_z9cQhasi25sGjmFnA/Skvd9rztS) for that design meeting. This would eventually supersede the existing `BitDenotation` interface. r? @ghost cc @rust-lang/compiler (esp. @eddyb and @pnkfelix)
bors
commented
Nov 15, 2019
☀️ Try build successful - checks-azure |
I migrated the analyses used during borrow checking/drop elaboration to the new framework and perf seems good. I'm gonna try a few small optimizations I mentioned during the design meeting over on that PR as well. While doing the conversion, it became apparent that code would much be nicer if we continued the "builder" style all the way back to let flow_inits = MaybeInitializedPlaces::new(tcx,&body,&mdpe);letmut flow_inits = dataflow::generic::Engine::new_gen_kill(tcx,&body, def_id, flow_inits).iterate_to_fixpoint().into_cursor(&body);could instead be written like this: letmut flow_inits = MaybeInitializedPlaces::new(tcx,&body,&mdpe).into_engine(tcx,&body, def_id).iterate_to_fixpoint().into_cursor(&body);Another idea was to add I think it will take a few revisions to find the optimal API, and this PR has been sitting in the queue for a while, so I think we should not block it on making a decision re: the aforementioned changes. For now I'm focused on resolving any outstanding concerns of @pnkfelix. |
1b8a726 to
d7a521dCompared7a521d to
7b4dca2Compareecstatic-morse
commented
Jan 20, 2020
@pnkfelix I addressed the motivation for the |
pnkfelix
commented
Jan 21, 2020
Thanks @ecstatic-morse ! |
pnkfelix
commented
Jan 21, 2020
@bors r+ |
bors
commented
Jan 21, 2020
📌 Commit 7b4dca2 has been approved by |
bors
commented
Jan 21, 2020
A single framework for gen-kill and generic dataflow problems This is the prototype implementation discussed in rust-lang/compiler-team#202. You can read a high-level description of it in [the proposal](https://hackmd.io/@39Qr_z9cQhasi25sGjmFnA/Skvd9rztS) for that design meeting. This would eventually supersede the existing `BitDenotation` interface. r? @ghost cc @rust-lang/compiler (esp. @eddyb and @pnkfelix)
bors
commented
Jan 21, 2020
☀️ Test successful - checks-azure |
…ls, r=pnkfelix Migrate borrowck dataflow impls to new framework This uses rust-lang#65672 to implement the dataflow analyses needed by borrowck. These include all the `InitializedPlaces` analyses as well as `Borrows`. Additionally, this PR contains several independent changes around the dataflow API which improve performance and make it more ergonomic. * An optimization that inhibits the caching of block transfer functions for acyclic MIR (~0.3% I-CNT savings). * A `ResultsVisitor` for dataflow results that is more efficient than `ResultsCursor` when we have to visit every statement unconditionally (~0.3% I-CNT savings). * An `into_engine` method on `Analysis` that selects the appropriate `Engine` constructor. * A `contains` method for `ResultsCursor` as a shorthand for `.get().contains()`. * A `find_descendants` helper on `MovePath` that replaces `has_any_child_of` on the old `FlowsAtLocation` These changes made porting the dataflow analyses much easier. Finally, this PR removes some now-unused code in `dataflow/at_location.rs` and elsewhere. You can view the perf results for the final version of this PR [here](https://perf.rust-lang.org/compare.html?start=29b854fb741809c29764e33fc17c32ba9c6523ba&end=6e516c1410c18cfe4eb6d030a39fdb73c8d8a4fe). Here's an example of the graphviz diagrams that are generated for the `MaybeInitializedPlaces` analysis. 
Migrate borrowck dataflow impls to new framework This uses #65672 to implement the dataflow analyses needed by borrowck. These include all the `InitializedPlaces` analyses as well as `Borrows`. Additionally, this PR contains several independent changes around the dataflow API which improve performance and make it more ergonomic. * An optimization that inhibits the caching of block transfer functions for acyclic MIR (~0.3% I-CNT savings). * A `ResultsVisitor` for dataflow results that is more efficient than `ResultsCursor` when we have to visit every statement unconditionally (~0.3% I-CNT savings). * An `into_engine` method on `Analysis` that selects the appropriate `Engine` constructor. * A `contains` method for `ResultsCursor` as a shorthand for `.get().contains()`. * A `find_descendants` helper on `MovePath` that replaces `has_any_child_of` on the old `FlowsAtLocation` These changes made porting the dataflow analyses much easier. Finally, this PR removes some now-unused code in `dataflow/at_location.rs` and elsewhere. You can view the perf results for the final version of this PR [here](https://perf.rust-lang.org/compare.html?start=29b854fb741809c29764e33fc17c32ba9c6523ba&end=6e516c1410c18cfe4eb6d030a39fdb73c8d8a4fe). Here's an example of the graphviz diagrams that are generated for the `MaybeInitializedPlaces` analysis. 
redundant_clone: Migrate to new dataflow framework Migration to [the new dataflow framework](rust-lang/rust#65672) is ongoing in rustc. This PR updates the dataflow impl in `redundant_clone` lint. --- changelog: none
…tmandry Use new dataflow framework for generators #65672 introduced a new dataflow framework that can handle arbitrarily complex transfer functions as well as ones expressed as a series of gen/kill operations. This PR ports the analyses used to implement generators to the new framework so that we can remove the old one. See #68241 for a prior example of this. The new framework has some superficial API changes, but this shouldn't alter the generator passes in any way. r? @tmandry
This is the prototype implementation discussed in rust-lang/compiler-team#202. You can read a high-level description of it in the proposal for that design meeting. This would eventually supersede the existing
BitDenotationinterface.r? @ghost
cc @rust-lang/compiler (esp. @eddyb and @pnkfelix)