]> granicus.if.org Git - llvm/commitdiff
SplitKit: Fix partially live subreg splitting
authorMatthias Braun <matze@braunis.de>
Mon, 12 Jun 2017 20:30:52 +0000 (20:30 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 12 Jun 2017 20:30:52 +0000 (20:30 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305228 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SplitKit.cpp

index 3a50aaa69985d3509e27ef7d848521d0b32bb647..008b984dd9616bff2e36e23c30a82b82d98ac297 100644 (file)
@@ -569,8 +569,7 @@ SlotIndex SplitEditor::buildCopy(unsigned FromReg, unsigned ToReg,
 
   // 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;