Skip to content

Commit 197bd3e

Browse files
author
Dale Johannesen
committed
Fix debug_value handling.
llvm-svn: 98224
1 parent 09db537 commit 197bd3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/lib/CodeGen/MachineCSE.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ bool MachineCSE::isPhysDefTriviallyDead(unsigned Reg,
122122
// Reached end of block, register is obviously dead.
123123
return true;
124124

125-
if (I->isDebugValue())
125+
if (I->isDebugValue()) {
126+
// These must not count against the limit.
127+
++LookAheadLeft;
128+
++I;
126129
continue;
130+
}
127131
bool SeenDef = false;
128132
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
129133
const MachineOperand &MO = I->getOperand(i);
@@ -188,7 +192,7 @@ static bool isCopy(const MachineInstr *MI, const TargetInstrInfo *TII) {
188192

189193
bool MachineCSE::isCSECandidate(MachineInstr *MI) {
190194
if (MI->isLabel() || MI->isPHI() || MI->isImplicitDef() ||
191-
MI->isKill() || MI->isInlineAsm())
195+
MI->isKill() || MI->isInlineAsm() || MI->isDebugValue())
192196
return false;
193197

194198
// Ignore copies.

0 commit comments

Comments
 (0)