diff options
| author | Dan Gohman <gohman@apple.com> | 2010-06-22 00:32:04 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-06-22 00:32:04 +0000 |
| commit | 0a36fc6946e4825448d29dd2d61e3ec192a1f3b3 (patch) | |
| tree | 05e4130204fad57ce01beba2f84fb0a5abbe5f4b | |
| parent | 6e9b04004d3bde7e68ab57b369e6092683e54ae2 (diff) | |
| download | external_llvm-0a36fc6946e4825448d29dd2d61e3ec192a1f3b3.zip external_llvm-0a36fc6946e4825448d29dd2d61e3ec192a1f3b3.tar.gz external_llvm-0a36fc6946e4825448d29dd2d61e3ec192a1f3b3.tar.bz2 | |
Fix the new load-unfolding code to update LiveVariable's dead flags,
in addition to the kill flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106512 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/CodeGen/TwoAddressInstructionPass.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 6144ecd..017d8b7 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -961,8 +961,14 @@ TryInstructionTransform(MachineBasicBlock::iterator &mi, if (LV) { for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) { MachineOperand &MO = mi->getOperand(i); - if (MO.isReg() && MO.isUse() && MO.isKill()) - LV->replaceKillInstruction(Reg, mi, NewMIs[0]); + if (MO.isReg() && MO.getReg() != 0 && + TargetRegisterInfo::isVirtualRegister(MO.getReg())) { + if (MO.isUse()) { + if (MO.isKill()) + LV->replaceKillInstruction(MO.getReg(), mi, NewMIs[0]); + } else if (LV->removeVirtualRegisterDead(MO.getReg(), mi)) + LV->addVirtualRegisterDead(MO.getReg(), NewMIs[1]); + } } LV->addVirtualRegisterKilled(Reg, NewMIs[1]); } |
