diff options
author | Dan Gohman <gohman@apple.com> | 2010-05-13 20:34:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-05-13 20:34:42 +0000 |
commit | e6cd757e6800b9b94a6459ec148c0624c4f2e3c1 (patch) | |
tree | d5f6dc0117786538e247416458b5f8fb9bed5367 /lib/CodeGen/MachineInstr.cpp | |
parent | 1e5a6c46b8f8cca0e4e6d582289bfd13cb462e39 (diff) |
Teach MachineLICM and MachineSink how to clear kill flags conservatively
when they move instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 99b5beb136..d909fb0ef3 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -938,6 +938,16 @@ isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx) const { return true; } +/// clearKillInfo - Clears kill flags on all operands. +/// +void MachineInstr::clearKillInfo() { + for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { + MachineOperand &MO = getOperand(i); + if (MO.isReg() && MO.isUse()) + MO.setIsKill(false); + } +} + /// copyKillDeadInfo - Copies kill / dead operand properties from MI. /// void MachineInstr::copyKillDeadInfo(const MachineInstr *MI) { |