Refactor code. Remove duplicated functions that basically do the same thing as
[oota-llvm.git] / lib / Target / ARM / ARMInstrInfo.cpp
index 30c1742ff77e9339667a26eef83355693d245557..babee6a43e787b17ed7298ef6799ea18a8e5c0e4 100644 (file)
@@ -294,8 +294,7 @@ ARMInstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
         for (unsigned j = 0; j < 2; ++j) {
           // Look at the two new MI's in reverse order.
           MachineInstr *NewMI = NewMIs[j];
-          int NIdx = NewMI->findRegisterUseOperandIdx(Reg);
-          if (NIdx == -1)
+          if (!NewMI->readsRegister(Reg))
             continue;
           LV.addVirtualRegisterKilled(Reg, NewMI);
           if (VI.removeKill(MI))