From bfe180af9eef1cf767f61f501ca325fcce2ae7ce 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29995 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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; } -- 2.11.0