Skip to content

Commit

Permalink
RegAllocGreedy: Fix nondeterminism in tryLastChanceRecoloring
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arsenm committed Jul 27, 2022
1 parent 28cd7f8 commit bfdca15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/RegAllocGreedy.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class LLVM_LIBRARY_VISIBILITY RAGreedy : public MachineFunctionPass,
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.
Expand Down

0 comments on commit bfdca15

Please sign in to comment.