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 | c90f51c00bd527970c45299df108ed0e01b055a9 (patch) | |
tree | e23064c791737d29071c967ec120a0df263e03bd /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 83887a7d3a1cfb0901850c09f57be335fe245cb0 (diff) | |
download | bcm5719-llvm-c90f51c00bd527970c45299df108ed0e01b055a9.tar.gz bcm5719-llvm-c90f51c00bd527970c45299df108ed0e01b055a9.zip |
Teach MachineLICM and MachineSink how to clear kill flags conservatively
when they move instructions.
llvm-svn: 103737
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 99b5beb1365..d909fb0ef3e 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/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) { |