Skip to content

Make MachineEnv statically allocatable by using PRegSet #252

@cfallin

Description

@cfallin

From Jamey's idea here: it would be nice for users of RA2 to be able to statically allocate MachineEnvs. The current bottleneck is that the struct contains Vecs with lists of "preferred" and "non-preferred" registers. These two lists are ordered wrt each other, but unordered wrt themselves, so we could represent each with a set instead. Specifically we have PRegSet which is a bitset and is Copy and statically allocatable (because there is a small, bounded maximum number of physical registers).

To implement this, we would need to update the RegTraversalIter's cursors over these lists to hold a bitset, and use a "find first bit" operation to find the index of the first entry. We can implement the shuffling behavior by holding two bitsets (two copies of the index space) and choosing some prefix, removing it from the first copy and putting it in the second copy.

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