Description
One of the artifacts left over from the old dataflow analysis code was that it had a NodeId
to bitvector index mapping that it maintained, since the NodeId
s in question were often sparse and also could fall into a range far from starting from zero.
When @pnkfelix converted the code to use the control-flow-graph abstraction, he switched things so that the CFGIndex
instead mapped to the relevant bitvector index, and then a different table mapped NodeId
to CFGIndex
.
The first aforementioned table is index_to_bitset
, here: https://github.com/rust-lang/rust/pull/14873/files#diff-158b34791d327b238be103c2d1867e71R48
That's fine, except that the assumptions that motivated using a bitvector index distinct from NodeId
(sparse, and starts from from zero) may not hold for CFGIndex
.
More specifically, CFGIndex
definitely starts from zero. And they are probably very very dense.
It would be good to:
- (Informally) confirm that
CFGIndex
is dense (i.e. gather some quick stats), and then - If the above hypothesis holds up, then get rid of the separate bitvector indices, and just use the
CFGIndex
directly as the index into the bitvector for dataflow.