aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-22 08:35:56 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-22 08:35:56 +0000
commit58207f12eefcb9cbfb6d9dc05a4efc6fa68fce28 (patch)
tree985a67c3338d5ddc73668c1194990c085dadc733 /lib
parent779aee1fea87ba27fd98a83a783386f51b5069a3 (diff)
downloadexternal_llvm-58207f12eefcb9cbfb6d9dc05a4efc6fa68fce28.zip
external_llvm-58207f12eefcb9cbfb6d9dc05a4efc6fa68fce28.tar.gz
external_llvm-58207f12eefcb9cbfb6d9dc05a4efc6fa68fce28.tar.bz2
If a use operand is marked isKill, don't forget to add kill to its live interval as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SimpleRegisterCoalescing.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index e5286c2..942d8d9 100644
--- a/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -519,6 +519,7 @@ SimpleRegisterCoalescing::TrimLiveIntervalToLastUse(unsigned CopyIdx,
// of last use.
LastUse->setIsKill();
removeRange(li, li_->getDefIndex(LastUseIdx), LR->end, li_, tri_);
+ li.addKill(LR->valno, LastUseIdx+1);
unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
if (tii_->isMoveInstr(*LastUseMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
DstReg == li.reg) {
@@ -967,9 +968,10 @@ void SimpleRegisterCoalescing::RemoveCopiesFromValNo(LiveInterval &li,
LastUse = MO;
}
}
- if (LastUse)
+ if (LastUse) {
LastUse->setIsKill();
- else {
+ li.addKill(VNI, LastUseIdx+1);
+ } else {
// Remove dead implicit_def's.
while (!ImpDefs.empty()) {
MachineInstr *ImpDef = ImpDefs.back();
@@ -2331,7 +2333,7 @@ SimpleRegisterCoalescing::lastRegisterUse(unsigned Start, unsigned End,
unsigned Idx = li_->getInstructionIndex(UseMI);
if (Idx >= Start && Idx < End && Idx >= UseIdx) {
LastUse = &Use;
- UseIdx = Idx;
+ UseIdx = li_->getUseIndex(Idx);
}
}
return LastUse;
@@ -2357,7 +2359,7 @@ SimpleRegisterCoalescing::lastRegisterUse(unsigned Start, unsigned End,
MachineOperand &Use = MI->getOperand(i);
if (Use.isReg() && Use.isUse() && Use.getReg() &&
tri_->regsOverlap(Use.getReg(), Reg)) {
- UseIdx = e;
+ UseIdx = li_->getUseIndex(e);
return &Use;
}
}