Previously, each live range would carry a list of uses in a SmallVec<[Use; 4]>, which was an inefficient use of memory.
This PR instead keeps a single Vec<Use> for all uses in a function, sorted by vreg and position. Each live range now holds a Range<u32> of indices which refer to its uses inside this vector.
Benchmarks show that this consistently improves compilation times by ~2%.
Previously, each live range would carry a list of uses in a
SmallVec<[Use; 4]>
, which was an inefficient use of memory.This PR instead keeps a single
Vec<Use>
for all uses in a function, sorted by vreg and position. Each live range now holds aRange<u32>
of indices which refer to its uses inside this vector.Benchmarks show that this consistently improves compilation times by ~2%.