summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-03-11 02:10:24 +0000
committerDale Johannesen <dalej@apple.com>2010-03-11 02:10:24 +0000
commite68ea060c78356253d771e039747fbc06c623646 (patch)
tree67b5e6fddb76412bba6c23997e94fa0029852912 /lib/CodeGen/MachineCSE.cpp
parent1f3e445184e5ca2aa4295c2a77f2a4e0b957fea1 (diff)
downloadllvm-e68ea060c78356253d771e039747fbc06c623646.tar.gz
llvm-e68ea060c78356253d771e039747fbc06c623646.tar.bz2
llvm-e68ea060c78356253d771e039747fbc06c623646.tar.xz
Fix debug_value handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineCSE.cpp')
-rw-r--r--lib/CodeGen/MachineCSE.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineCSE.cpp b/lib/CodeGen/MachineCSE.cpp
index ce95d8d05e..91d3635882 100644
--- a/lib/CodeGen/MachineCSE.cpp
+++ b/lib/CodeGen/MachineCSE.cpp
@@ -122,8 +122,12 @@ bool MachineCSE::isPhysDefTriviallyDead(unsigned Reg,
// Reached end of block, register is obviously dead.
return true;
- if (I->isDebugValue())
+ if (I->isDebugValue()) {
+ // These must not count against the limit.
+ ++LookAheadLeft;
+ ++I;
continue;
+ }
bool SeenDef = false;
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = I->getOperand(i);
@@ -188,7 +192,7 @@ static bool isCopy(const MachineInstr *MI, const TargetInstrInfo *TII) {
bool MachineCSE::isCSECandidate(MachineInstr *MI) {
if (MI->isLabel() || MI->isPHI() || MI->isImplicitDef() ||
- MI->isKill() || MI->isInlineAsm())
+ MI->isKill() || MI->isInlineAsm() || MI->isDebugValue())
return false;
// Ignore copies.