Skip to content

dataflow: use CFGIndex directly as bitvector index #15019

Closed
@pnkfelix

Description

@pnkfelix

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 NodeIds 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:

  1. (Informally) confirm that CFGIndex is dense (i.e. gather some quick stats), and then
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions