Minor correction to r130877; fixes PR9846 and hopefully the buildbot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130925 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/MachineCSE.cpp b/lib/CodeGen/MachineCSE.cpp
index 5d79e96..341afd9 100644
--- a/lib/CodeGen/MachineCSE.cpp
+++ b/lib/CodeGen/MachineCSE.cpp
@@ -468,7 +468,8 @@
SmallVector<unsigned,8>::iterator PI = DirectPhysRefs.begin(),
PE = DirectPhysRefs.end();
for (; PI != PE; ++PI)
- MBB->addLiveIn(*PI);
+ if (!MBB->isLiveIn(*PI))
+ MBB->addLiveIn(*PI);
}
++NumCSEs;
if (!PhysRefs.empty())