[llvm-commits] [llvm] r157102 - /llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri May 18 22:25:53 PDT 2012


Author: stoklund
Date: Sat May 19 00:25:53 2012
New Revision: 157102

URL: http://llvm.org/viewvc/llvm-project?rev=157102&view=rev
Log:
Immediately erase trivially useless copies.

There is no need for these instructions to stick around since they are
known to be not dead.

Modified:
    llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp

Modified: llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp?rev=157102&r1=157101&r2=157102&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Sat May 19 00:25:53 2012
@@ -1070,15 +1070,17 @@
 
   // If they are already joined we continue.
   if (CP.getSrcReg() == CP.getDstReg()) {
-    markAsJoined(CopyMI);
     DEBUG(dbgs() << "\tCopy already coalesced.\n");
+    LIS->RemoveMachineInstrFromMaps(CopyMI);
+    CopyMI->eraseFromParent();
     return false;  // Not coalescable.
   }
 
   // Eliminate undefs.
   if (!CP.isPhys() && eliminateUndefCopy(CopyMI, CP)) {
-    markAsJoined(CopyMI);
     DEBUG(dbgs() << "\tEliminated copy of <undef> value.\n");
+    LIS->RemoveMachineInstrFromMaps(CopyMI);
+    CopyMI->eraseFromParent();
     return false;  // Not coalescable.
   }
 





More information about the llvm-commits mailing list