[llvm-commits] [llvm] r56067 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp

Owen Anderson resistor at mac.com
Wed Sep 10 13:41:14 PDT 2008


Author: resistor
Date: Wed Sep 10 15:41:13 2008
New Revision: 56067

URL: http://llvm.org/viewvc/llvm-project?rev=56067&view=rev
Log:
Fix a bug in the coalescer where it didn't check if a live interval existed before trying to manipulate it.  This
was exposed by fast isel's handling of shifts on X86-64.  With this, FreeBench/pcompress2 passes on X86-64 in fast isel.

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

Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=56067&r1=56066&r2=56067&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Sep 10 15:41:13 2008
@@ -464,7 +464,7 @@
     MachineOperand &MO = CopyMI->getOperand(i);
     if (MO.isReg() && MO.isImplicit())
       NewMI->addOperand(MO);
-    if (MO.isDef()) {
+    if (MO.isDef() && li_->hasInterval(MO.getReg())) {
       unsigned Reg = MO.getReg();
       DLR = li_->getInterval(Reg).getLiveRangeContaining(DefIdx);
       if (DLR && DLR->valno->copy == CopyMI)





More information about the llvm-commits mailing list