diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-02-23 01:04:26 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-02-23 01:04:26 +0000 |
commit | 76d7e76c15c258ec4a71fd75a2a32bca3a5e5e27 (patch) | |
tree | 64ce602cfc27a30c7a1527c10772cf73286fb38e /lib/CodeGen | |
parent | 96fa612373e258120d351ed14361f964ad22f99d (diff) |
Use findRegisterUseOperand to find a kill of particular register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 01a3e3ee38..8c5da0272f 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -170,12 +170,14 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { } /// findRegisterUseOperand() - Returns the MachineOperand that is a use of -/// the specific register or NULL if it is not found. -MachineOperand *MachineInstr::findRegisterUseOperand(unsigned Reg) { +/// the specific register or NULL if it is not found. It further tightening +/// the search criteria to a use that kills the register if isKill is true. +MachineOperand *MachineInstr::findRegisterUseOperand(unsigned Reg, bool isKill){ for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { MachineOperand &MO = getOperand(i); if (MO.isReg() && MO.isUse() && MO.getReg() == Reg) - return &MO; + if (!isKill || MO.isKill()) + return &MO; } return NULL; } |