summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-07-08 22:30:38 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-07-08 22:30:38 +0000
commit75c465585acc11ca8f985623e6cc51f2eb895608 (patch)
treea4f785823eccabb8230ce05a3b384ab789e9dddd /llvm/lib/CodeGen
parentec58a43d81d99a46af9bbc57bbcfe8e564bba54b (diff)
downloadbcm5719-llvm-75c465585acc11ca8f985623e6cc51f2eb895608.tar.gz
bcm5719-llvm-75c465585acc11ca8f985623e6cc51f2eb895608.zip
Fix broken isCopy handling in TrimLiveIntervalToLastUse
llvm-svn: 107921
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 551866ee76a..2e7e6f8b158 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -618,10 +618,14 @@ SimpleRegisterCoalescing::TrimLiveIntervalToLastUse(SlotIndex CopyIdx,
// of last use.
LastUse->setIsKill();
removeRange(li, LastUseIdx.getDefIndex(), LR->end, li_, tri_);
+ if (LastUseMI->isCopy()) {
+ MachineOperand &DefMO = LastUseMI->getOperand(0);
+ if (DefMO.getReg() == li.reg && !DefMO.getSubReg())
+ DefMO.setIsDead();
+ }
unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
- if ((LastUseMI->isCopy() && !LastUseMI->getOperand(0).getSubReg()) ||
- (tii_->isMoveInstr(*LastUseMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
- DstReg == li.reg && DstSubIdx == 0)) {
+ if (tii_->isMoveInstr(*LastUseMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
+ DstReg == li.reg && DstSubIdx == 0) {
// Last use is itself an identity code.
int DeadIdx = LastUseMI->findRegisterDefOperandIdx(li.reg,
false, false, tri_);
OpenPOWER on IntegriCloud