From d4ee71db504ece4b105d206bddb3660a3bcb2c71 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 12 Aug 2006 05:41:39 +0000 Subject: [PATCH] Fix an obvious bug, noticed by inspection. No current targets trigger this. llvm-svn: 29648 --- lib/CodeGen/PHIElimination.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index ffbae2a7ff7..fef833cc19f 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -103,9 +103,9 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) { /// use of the specified register. static bool InstructionUsesRegister(MachineInstr *MI, unsigned SrcReg) { for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) - if (MI->getOperand(0).isRegister() && - MI->getOperand(0).getReg() == SrcReg && - MI->getOperand(0).isUse()) + if (MI->getOperand(i).isRegister() && + MI->getOperand(i).getReg() == SrcReg && + MI->getOperand(i).isUse()) return true; return false; }