-
Notifications
You must be signed in to change notification settings - Fork 45
Description
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.