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.
Simplifying tapes requires tracking which (SSA) values are live at a given time. This is tracked in
VmWorkspace::bind, which stores a register binding (oru32::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_zerosto 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
u64array indicating which opcodes are choice-writing; then, sufficiently clever masking andcount_onescan keep the choice iterator in sync.