If known DebugLocs do not match then two DBG_VALUE machine instructions are not ident...
[oota-llvm.git] / lib / CodeGen / MachineInstr.cpp
index f490713e7200c61d8c0e78e1c9148463487b27ee..143a29b08a1e44ebe1adc39da742b89c1e0132be 100644 (file)
@@ -802,6 +802,11 @@ bool MachineInstr::isIdenticalTo(const MachineInstr *Other,
         return false;
     }
   }
+  // If DebugLoc does not match then two dbg.values are not identical.
+  if (isDebugValue())
+    if (!getDebugLoc().isUnknown() && !Other->getDebugLoc().isUnknown()
+        && getDebugLoc() != Other->getDebugLoc())
+      return false;
   return true;
 }