Skip to content

Bitpacked liveness tracking #427

Description

@mkeeter

Simplifying tapes requires tracking which (SSA) values are live at a given time. This is tracked in VmWorkspace::bind, which stores a register binding (or u32::MAX) for every value in the SSA tape. When simplifying the tape, we iterate over every single value in the tape, checking each one's liveness.

In cases where liveness is sparse, it would be more efficient to store a bitpacked array of liveness (one bit per SSA operation). Then, we could use u64::leading_zeros to skip up to 64 values at a time.

There's one catch: we must move the choice iterator whenever a choice-writing opcode is seen in the tape. We probably want a separate bit-packed u64 array indicating which opcodes are choice-writing; then, sufficiently clever masking and count_ones can keep the choice iterator in sync.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions