From 1020604f2c049d92d23e98bb299954e9d9039e97 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 31 Aug 2006 05:58:59 +0000 Subject: [PATCH] Delete copies as they are coallesced instead of waiting until the end. llvm-svn: 29995 --- lib/CodeGen/LiveIntervalAnalysis.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 82389b20b32..b4bbb668b68 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -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; }