summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commit197bd3eee916a643363ff33692356c989cf23001 (patch)
tree196b58ef5700eaa043d1fce81690f5947a56e444 /llvm/lib/CodeGen
parent09db5370b7847c5c120a129768a0ce8328a6f5a1 (diff)
downloadbcm5719-llvm-197bd3eee916a643363ff33692356c989cf23001.tar.gz
bcm5719-llvm-197bd3eee916a643363ff33692356c989cf23001.zip
Fix debug_value handling.
llvm-svn: 98224
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index ce95d8d05ea..91d36358829 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud