We never call adjustCopiesBackFrom() for partial copies.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 15 May 2012 22:18:49 +0000 (22:18 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 15 May 2012 22:18:49 +0000 (22:18 +0000)
There is no need to look at an always null SrcIdx.

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

lib/CodeGen/RegisterCoalescer.cpp

index 8795c0d7151f50061ddf527655da85c7f07ad9be..00393bbe8af5b03fa02b9153e2fbc010f67caa90 100644 (file)
@@ -408,6 +408,8 @@ void RegisterCoalescer::markAsJoined(MachineInstr *CopyMI) {
 ///
 bool RegisterCoalescer::adjustCopiesBackFrom(const CoalescerPair &CP,
                                              MachineInstr *CopyMI) {
+  assert(!CP.isPartial() && "This doesn't work for partial copies.");
+
   // Bail if there is no dst interval - can happen when merging physical subreg
   // operations.
   if (!LIS->hasInterval(CP.getDstReg()))
@@ -529,7 +531,7 @@ bool RegisterCoalescer::adjustCopiesBackFrom(const CoalescerPair &CP,
   // Rewrite the copy. If the copy instruction was killing the destination
   // register before the merge, find the last use and trim the live range. That
   // will also add the isKill marker.
-  CopyMI->substituteRegister(IntA.reg, IntB.reg, CP.getSrcIdx(), *TRI);
+  CopyMI->substituteRegister(IntA.reg, IntB.reg, 0, *TRI);
   if (ALR->end == CopyIdx)
     LIS->shrinkToUses(&IntA);