summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-12-05 10:24:35 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-12-05 10:24:35 +0000
commit678b86d6cec6dbc2f7c4d8b29fd788fb7db57e2d (patch)
tree91f77bd59bac867875133e21d7464bbc999d8ff0 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent06353b48b5df6eed9ece03c921dfe7c7575eeba1 (diff)
downloadbcm5719-llvm-678b86d6cec6dbc2f7c4d8b29fd788fb7db57e2d.tar.gz
bcm5719-llvm-678b86d6cec6dbc2f7c4d8b29fd788fb7db57e2d.zip
MachineInstr can change. Store indexes instead.
llvm-svn: 44612
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index b321b3fdf6b..a9e69483be4 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1165,6 +1165,15 @@ addIntervalsForSpills(const LiveInterval &li,
// it's also guaranteed to be a single val# / range interval.
if (vrm.getPreSplitReg(li.reg)) {
vrm.setIsSplitFromReg(li.reg, 0);
+ // Unset the split kill marker on the last use.
+ unsigned KillIdx = vrm.getKillPoint(li.reg);
+ if (KillIdx) {
+ MachineInstr *KillMI = getInstructionFromIndex(KillIdx);
+ assert(KillMI && "Last use disappeared?");
+ int KillOp = KillMI->findRegisterUseOperandIdx(li.reg, true);
+ assert(KillOp != -1 && "Last use disappeared?");
+ KillMI->getOperand(KillOp).unsetIsKill();
+ }
vrm.removeKillPoint(li.reg);
bool DefIsReMat = vrm.isReMaterialized(li.reg);
Slot = vrm.getStackSlot(li.reg);
@@ -1395,13 +1404,14 @@ addIntervalsForSpills(const LiveInterval &li,
LI->weight /= LI->getSize();
if (!AddedKill.count(LI)) {
LiveRange *LR = &LI->ranges[LI->ranges.size()-1];
- MachineInstr *LastUse = getInstructionFromIndex(getBaseIndex(LR->end));
+ unsigned LastUseIdx = getBaseIndex(LR->end);
+ MachineInstr *LastUse = getInstructionFromIndex(LastUseIdx);
int UseIdx = LastUse->findRegisterUseOperandIdx(LI->reg);
assert(UseIdx != -1);
if (LastUse->getInstrDescriptor()->
getOperandConstraint(UseIdx, TOI::TIED_TO) == -1) {
LastUse->getOperand(UseIdx).setIsKill();
- vrm.addKillPoint(LI->reg, &LastUse->getOperand(UseIdx));
+ vrm.addKillPoint(LI->reg, LastUseIdx);
}
}
RetNewLIs.push_back(LI);
OpenPOWER on IntegriCloud