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

Rafael Espindola rafael.espindola at gmail.com
Fri Jul 1 22:34:02 PDT 2011


Author: rafael
Date: Sat Jul  2 00:34:02 2011
New Revision: 134309

URL: http://llvm.org/viewvc/llvm-project?rev=134309&view=rev
Log:
Check the VN of the src register at the two copies, not just the
register number.

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=134309&r1=134308&r2=134309&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp Sat Jul  2 00:34:02 2011
@@ -1203,7 +1203,6 @@
                                           VNInfo *VNI,
                                           LiveRange *LR,
                                      SmallVector<MachineInstr*, 8> &DupCopies) {
-  return false; // To see if this fixes the i386 dragonegg buildbot miscompile.
   // FIXME: This is very conservative. For example, we don't handle
   // physical registers.
 
@@ -1252,6 +1251,12 @@
   if (Src != OtherSrc)
     return false;
 
+  // If the copies use two different value numbers of X, we cannot merge
+  // A and B.
+  if (SrcInt.FindLiveRangeContaining(Other->def)->valno !=
+      SrcInt.FindLiveRangeContaining(VNI->def)->valno)
+    return false;
+
   DupCopies.push_back(MI);
 
   return true;





More information about the llvm-commits mailing list