Fix an extremely stupid bug that prevented first round of coalescing (physical regist...
authorEvan Cheng <evan.cheng@apple.com>
Tue, 9 Oct 2007 23:36:27 +0000 (23:36 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 9 Oct 2007 23:36:27 +0000 (23:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42820 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SimpleRegisterCoalescing.cpp

index 5ef838c33a033ed26f50a56aa476082c05694964..4c1a96dd7d1eed985d339c3003f9d367c64a82fc 100644 (file)
@@ -861,7 +861,8 @@ void SimpleRegisterCoalescing::CopyCoalesceInMBB(MachineBasicBlock *MBB,
     unsigned SrcReg, DstReg;
     if (!tii_->isMoveInstr(*Inst, SrcReg, DstReg)) continue;
     
-    if (TryAgain && !JoinCopy(Inst, SrcReg, DstReg, PhysOnly))
+    bool Success = JoinCopy(Inst, SrcReg, DstReg, PhysOnly);
+    if (TryAgain && !Success)
       TryAgain->push_back(getCopyRec(Inst, SrcReg, DstReg));
   }
 }