Fix a potential bug that can cause miscomparison with and without debug info.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 17 Sep 2010 21:56:26 +0000 (21:56 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 17 Sep 2010 21:56:26 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114220 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineCSE.cpp

index 92e2299ec62fa5166639d69f5a7f9219e1866355..39a50d2078f0c26d2a8cc46296cdf10244032b65 100644 (file)
@@ -101,7 +101,7 @@ bool MachineCSE::PerformTrivialCoalescing(MachineInstr *MI,
     unsigned Reg = MO.getReg();
     if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg))
       continue;
-    if (!MRI->hasOneUse(Reg))
+    if (!MRI->hasOneNonDBGUse(Reg))
       // Only coalesce single use copies. This ensure the copy will be
       // deleted.
       continue;