aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/PreAllocSplitting.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-12-28 23:35:13 +0000
committerOwen Anderson <resistor@mac.com>2008-12-28 23:35:13 +0000
commitd4f6fe55ebe9d053cab73f5e67cac95e32df887b (patch)
treedf4ce75f397e3a25a3e86e725ed3ecc56235355a /lib/CodeGen/PreAllocSplitting.cpp
parent169d4080277c71548de52b54c8a79f99694351c6 (diff)
Fix up kill/dead marking in the new live interval reconstruction code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PreAllocSplitting.cpp')
-rw-r--r--lib/CodeGen/PreAllocSplitting.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/CodeGen/PreAllocSplitting.cpp b/lib/CodeGen/PreAllocSplitting.cpp
index 0880f62297..3f303ae098 100644
--- a/lib/CodeGen/PreAllocSplitting.cpp
+++ b/lib/CodeGen/PreAllocSplitting.cpp
@@ -722,10 +722,9 @@ VNInfo* PreAllocSplitting::PerformPHIConstruction(
NewVNs, Visited, false);
// FIXME: Need to set kills properly for inter-block stuff.
- if (toplevel) {
- if (LI->isKill(ret, UseIndex)) LI->removeKill(ret, UseIndex);
+ if (LI->isKill(ret, UseIndex)) LI->removeKill(ret, UseIndex);
+ if (toplevel)
LI->addKill(ret, EndIndex);
- }
LI->addRange(LiveRange(UseIndex, EndIndex, ret));
} else if (ContainsDefs && ContainsUses){
@@ -778,10 +777,9 @@ VNInfo* PreAllocSplitting::PerformPHIConstruction(
ret = PerformPHIConstruction(walker, LI, Defs, Uses,
NewVNs, Visited, false);
- // FIXME: Need to set kills properly for inter-block stuff.
+ if (foundUse && LI->isKill(ret, StartIndex))
+ LI->removeKill(ret, StartIndex);
if (toplevel) {
- if (foundUse && LI->isKill(ret, StartIndex))
- LI->removeKill(ret, StartIndex);
LI->addKill(ret, EndIndex);
}
@@ -834,6 +832,20 @@ void PreAllocSplitting::ReconstructLiveInterval(LiveInterval* LI) {
DenseMap<MachineBasicBlock*, VNInfo*> Visited;
PerformPHIConstruction(&*UI, LI, Defs, Uses, NewVNs, Visited, true);
}
+
+ // Add ranges for dead defs
+ for (MachineRegisterInfo::def_iterator DI = MRI->def_begin(LI->reg),
+ DE = MRI->def_end(); DI != DE; ++DI) {
+ unsigned DefIdx = LIs->getInstructionIndex(&*DI);
+ DefIdx = LiveIntervals::getDefIndex(DefIdx);
+ unsigned UseIdx = LiveIntervals::getUseIndex(DefIdx);
+
+ if (LI->liveAt(DefIdx)) continue;
+
+ VNInfo* DeadVN = NewVNs[&*DI];
+ LI->addRange(LiveRange(DefIdx, UseIdx, DeadVN));
+ LI->addKill(DeadVN, DefIdx);
+ }
}
/// ShrinkWrapLiveInterval - Recursively traverse the predecessor