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