Dead live-in detection bug.
[oota-llvm.git] / lib / CodeGen / LiveIntervalAnalysis.cpp
index 6e516f560e5459ae6dbaa8b9b15fa43b41182394..26d741f6898bc8bea591a3d4e5d6ba801dd73b4a 100644 (file)
@@ -938,11 +938,11 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
   if (JoinIntervals(DestInt, SrcInt)) {
     if (isDead) {
       // Result of the copy is dead. Propagate this property.
-      if (SrcStart == 0 && MRegisterInfo::isPhysicalRegister(SrcReg)) {
+      if (SrcStart == 0 && MRegisterInfo::isPhysicalRegister(repSrcReg)) {
         // Live-in to the function but dead. Remove it from MBB live-in set.
         // JoinIntervals may end up swapping the two intervals.
         MachineBasicBlock *MBB = CopyMI->getParent();
-        MBB->removeLiveIn(SrcReg);
+        MBB->removeLiveIn(repSrcReg);
       } else {
         MachineInstr *SrcMI = getInstructionFromIndex(SrcStart);
         if (SrcMI) {
@@ -988,7 +988,6 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
   DOUT << "\n\t\tJoined.  Result = "; DestInt.print(DOUT, mri_);
   DOUT << "\n";
 
-#if 1
   // Remember these liveintervals have been joined.
   JoinedLIs.set(repSrcReg - MRegisterInfo::FirstVirtualRegister);
   if (MRegisterInfo::isVirtualRegister(repDstReg))