[PATCH] D130651: RegAllocGreedy: Fix nondeterminism in tryLastChanceRecoloring

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 10:31:05 PDT 2022


arsenm created this revision.
arsenm added reviewers: qcolombet, MatzeB, uabelho.
Herald added subscribers: mgrang, hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D130651

Files:
  llvm/lib/CodeGen/RegAllocGreedy.h


Index: llvm/lib/CodeGen/RegAllocGreedy.h
===================================================================
--- llvm/lib/CodeGen/RegAllocGreedy.h
+++ llvm/lib/CodeGen/RegAllocGreedy.h
@@ -150,7 +150,7 @@
 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130651.448093.patch
Type: text/x-patch
Size: 566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/74bbb0f0/attachment.bin>


More information about the llvm-commits mailing list