Delete copies as they are coallesced instead of waiting until the end.
authorChris Lattner <sabre@nondot.org>
Thu, 31 Aug 2006 05:58:59 +0000 (05:58 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 31 Aug 2006 05:58:59 +0000 (05:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29995 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveIntervalAnalysis.cpp

index 82389b20b326535f8f9acf539a9b21e2fb9c9d6e..b4bbb668b6814f318ce76ff1b35ec88d53fdf051 100644 (file)
@@ -823,6 +823,10 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
   r2iMap_.erase(SrcReg);
   r2rMap_[SrcReg] = DstReg;
 
+  // Finally, delete the copy instruction.
+  RemoveMachineInstrFromMaps(CopyMI);
+  CopyMI->eraseFromParent();
+  ++numPeep;
   ++numJoins;
   return true;
 }