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

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


Author: stoklund
Date: Sat May 19 00:25:59 2012
New Revision: 157104

URL: http://llvm.org/viewvc/llvm-project?rev=157104&view=rev
Log:
Eliminate dead code after remat.

This will remove the original def once it has no more uses.

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=157104&r1=157103&r2=157104&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Sat May 19 00:25:59 2012
@@ -870,7 +870,9 @@
   ++NumReMats;
 
   // The source interval can become smaller because we removed a use.
-  LIS->shrinkToUses(&SrcInt);
+  LIS->shrinkToUses(&SrcInt, &DeadDefs);
+  if (!DeadDefs.empty())
+    eliminateDeadDefs();
 
   return true;
 }





More information about the llvm-commits mailing list