[llvm-commits] [llvm] r156866 - /llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue May 15 15:18:49 PDT 2012


Author: stoklund
Date: Tue May 15 17:18:49 2012
New Revision: 156866

URL: http://llvm.org/viewvc/llvm-project?rev=156866&view=rev
Log:
We never call adjustCopiesBackFrom() for partial copies.

There is no need to look at an always null SrcIdx.

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

Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=156866&r1=156865&r2=156866&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Tue May 15 17:18:49 2012
@@ -408,6 +408,8 @@
 ///
 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 @@
   // 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);
 





More information about the llvm-commits mailing list