-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[NLL] convert NLL Region
representation into a bit set
#45670
Comments
I volunteer. |
@zackmdavis great! you may want to start building from #45668, or just wait till it lands |
@zackmdavis it landed =) Note however that the new PR #45825 also touches the relevant code, though I don't think it should make much difference to this change. |
Note the new policy on landing things for NLL -- basically, use the |
@zackmdavis have you had a chance to poke at this? |
@nikomatsakis I took a look, but don't have anything to submit yet; I regret the delay. Understood re |
(current WIP is still zackmdavis/rust@d5d4311105; current plan is to address comments Monday; motivated to avert stereotype of flaky, unreliable open-source contributor) |
This should be more efficient than allocating two BTreeSets for every region variable?—as it is written in rust-lang#45670.
This should be more efficient than allocating two BTreeSets for every region variable?—as it is written in rust-lang#45670.
This should be more efficient than allocating two BTreeSets for every region variable?—as it is written in rust-lang#45670.
This is done. |
This should be more efficient than allocating two BTreeSets for every region variable?—as it is written in rust-lang#45670.
This should be more efficient than allocating two BTreeSets for every region variable?—as it is written in rust-lang#45670.
The present set of NLL patches uses a terribly inefficient representation for regions consisting of two btrees. I think what we probably want is to use a
librustc_data_structures::bitvec::BitMatrix
, which is a 2D matrix where each cell can be a boolean. The "rows" here would be the region indices and the "columns" would be the locations + free regions.As of #45668, the representation of
Region
is encapsulated within theregion_context.rs
module, so this change should be fairly easy to make. The basic idea would be that, when we initialize theRegionInferenceContext
, we have on hand everything we need to allocate theBitMatrix
-- that is, we know how many rows and columns we will need.So the basic steps would be:
Location
to its column index.init_free_regions
; it is basically a loop over the basic blocks and then the locations within each basic block.value
field fromRegionDefinition
BitMatrix
stored as a field in theRegionInferenceContext
value
field likeregion_contains_point
, this should be largely straightforwardBitMatrix
already supports some APIs for that, we may want to add a few more or just tweak howDFS
worksThe text was updated successfully, but these errors were encountered: