[llvm] r305228 - SplitKit: Fix partially live subreg splitting

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 12 13:30:53 PDT 2017


Author: matze
Date: Mon Jun 12 15:30:52 2017
New Revision: 305228

URL: http://llvm.org/viewvc/llvm-project?rev=305228&view=rev
Log:
SplitKit: Fix partially live subreg splitting

Fix thinko/typo in subreg aware liverange splitting logic. I'm not sure
how to write a proper testcase for this. The original problem only
happens on an out-of-tree target. Forcing subreg enabled targets to
spill and split in a predictable way is near impossible.

Modified:
    llvm/trunk/lib/CodeGen/SplitKit.cpp

Modified: llvm/trunk/lib/CodeGen/SplitKit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SplitKit.cpp?rev=305228&r1=305227&r2=305228&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SplitKit.cpp (original)
+++ llvm/trunk/lib/CodeGen/SplitKit.cpp Mon Jun 12 15:30:52 2017
@@ -569,8 +569,7 @@ SlotIndex SplitEditor::buildCopy(unsigne
 
   // Greedy heuristic: Keep iterating keeping the best covering subreg index
   // each time.
-  LaneBitmask LanesLeft =
-      LaneMask & ~(TRI.getSubRegIndexLaneMask(BestCover));
+  LaneBitmask LanesLeft = LaneMask & ~(TRI.getSubRegIndexLaneMask(BestIdx));
   while (LanesLeft.any()) {
     unsigned BestIdx = 0;
     int BestCover = INT_MIN;




More information about the llvm-commits mailing list