summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-22 00:32:04 +0000
committerDan Gohman <gohman@apple.com>2010-06-22 00:32:04 +0000
commit851e478e6bc21e90e41343a3767c845ff6294dd2 (patch)
tree5ca6263b488c72e1fa4af14df44dad9dec616879 /llvm/lib/CodeGen
parent469b2003211472d5eae8b20f87fc5b88aa7b07fd (diff)
downloadbcm5719-llvm-851e478e6bc21e90e41343a3767c845ff6294dd2.tar.gz
bcm5719-llvm-851e478e6bc21e90e41343a3767c845ff6294dd2.zip
Fix the new load-unfolding code to update LiveVariable's dead flags,
in addition to the kill flags. llvm-svn: 106512
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 6144ecd002e..017d8b772f9 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/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]);
}
OpenPOWER on IntegriCloud