-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[nll] introduce dirty list to dataflow #51813
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
Comments
A few tips into the code to get you started. rust/src/librustc_mir/dataflow/mod.rs Lines 123 to 136 in 764232c
It invokes rust/src/librustc_mir/dataflow/mod.rs Lines 77 to 81 in 764232c
This in turn invokes rust/src/librustc_mir/dataflow/mod.rs Lines 184 to 194 in 764232c
which calls rust/src/librustc_mir/dataflow/mod.rs Line 238 in 764232c
rust/src/librustc_mir/dataflow/mod.rs Line 240 in 764232c
for each one, it takes the current "start point" and applies the gen-kill sets: rust/src/librustc_mir/dataflow/mod.rs Lines 243 to 247 in 764232c
Finally, it takes that result and pushes it into the "start set" for the successors (sometimes applying a diff along the way): rust/src/librustc_mir/dataflow/mod.rs Lines 249 to 250 in 764232c
Likely, it would be more efficient to keep some kind of "dirty bits" indicating which basic blocks may need to be processed at all. Things would be added to this list by that final function call -- i.e., instead of saying "changed = true", we would push onto the list. Then in the next round we start by processing the elements on that list, and we repeat this until the list comes back as empty. Or something like that. |
UPDATE: I've moved the content of this comment, which discussed liveness, to bug #51819 |
(In principle, it might be a win to convert these computations to use datafrog as well, but that would require more intrusive changes, I imagine.) |
@PramodBisht and I have been discussing how to fix this bug in a bit more detail on Zulip. Here is the thread devoted to this issue. |
@PramodBisht opened #51900 -- this seems to do what I asked, however my local measurements suggest it is not a performance win. Curious. We may want to try other evaluation orders. |
I cited this paper here: https://pdfs.semanticscholar.org/db53/41a4bc653b84a12780139d795a910c1c8b60.pdf |
This is done =) |
Uh oh!
There was an error while loading. Please reload this page.
I've been examining profiling results of the clap-rs test case (I am profiling the #51538 branch, more specifically). One clear hot spot is the
do_dataflow
, which accounts for 18% of MIR borrow check time. It is a fairly naive "fixed point" iteration that propagate bits around. It can (probably) be improved by introducing a "dirty list" to avoid processing basic blocks whose contents have not changed.The text was updated successfully, but these errors were encountered: