RegAllocGreedy: Fix nondeterminism in tryLastChanceRecoloring

tryLastChanceRecoloring iterates over the set of LiveInterval pointers
and used that to seed the recoloring stack, which was
nondeterministic. Fixes a future test failing about 20% of the time.

This just takes the order the interfering vreg was encountered. Not
sure if we should try to order this more intelligently.
This commit is contained in:
Matt Arsenault 2022-07-27 09:26:41 -04:00
parent 28cd7f86ed
commit bfdca1535c

View File

@ -150,7 +150,7 @@ public:
private:
// Convenient shortcuts.
using PQueue = std::priority_queue<std::pair<unsigned, unsigned>>;
using SmallLISet = SmallPtrSet<const LiveInterval *, 4>;
using SmallLISet = SmallSetVector<const LiveInterval *, 4>;
// We need to track all tentative recolorings so we can roll back any
// successful and unsuccessful recoloring attempts.