aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-01-26 21:27:03 +0000
committerBill Wendling <isanbard@gmail.com>2009-01-26 21:27:03 +0000
commit21f563649d9859a1bdc424fecb18cbdd7807aa05 (patch)
treefecda31142121d3d63bd5e8029629e7a5c0c528e
parentbda1a1523f944f6cba7f9b9dbe62af05fe452b18 (diff)
downloadexternal_llvm-21f563649d9859a1bdc424fecb18cbdd7807aa05.zip
external_llvm-21f563649d9859a1bdc424fecb18cbdd7807aa05.tar.gz
external_llvm-21f563649d9859a1bdc424fecb18cbdd7807aa05.tar.bz2
Temporarily revert r63025 until the testsuite failures can be fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63040 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/PreAllocSplitting.cpp46
1 files changed, 34 insertions, 12 deletions
diff --git a/lib/CodeGen/PreAllocSplitting.cpp b/lib/CodeGen/PreAllocSplitting.cpp
index 49cc67b..09b39fa 100644
--- a/lib/CodeGen/PreAllocSplitting.cpp
+++ b/lib/CodeGen/PreAllocSplitting.cpp
@@ -563,12 +563,12 @@ VNInfo* PreAllocSplitting::PerformPHIConstruction(
ret = PerformPHIConstruction(walker, MBB, LI, Visited, Defs, Uses,
NewVNs, LiveOut, Phis, false, true);
- LI->addRange(LiveRange(UseIndex, EndIndex+1, ret));
-
// FIXME: Need to set kills properly for inter-block stuff.
if (LI->isKill(ret, UseIndex)) LI->removeKill(ret, UseIndex);
if (intrablock)
LI->addKill(ret, EndIndex);
+
+ LI->addRange(LiveRange(UseIndex, EndIndex+1, ret));
} else if (ContainsDefs && ContainsUses){
SmallPtrSet<MachineInstr*, 2>& BlockDefs = Defs[MBB];
SmallPtrSet<MachineInstr*, 2>& BlockUses = Uses[MBB];
@@ -620,13 +620,13 @@ VNInfo* PreAllocSplitting::PerformPHIConstruction(
ret = PerformPHIConstruction(walker, MBB, LI, Visited, Defs, Uses,
NewVNs, LiveOut, Phis, false, true);
- LI->addRange(LiveRange(StartIndex, EndIndex+1, ret));
-
if (foundUse && LI->isKill(ret, StartIndex))
LI->removeKill(ret, StartIndex);
if (intrablock) {
LI->addKill(ret, EndIndex);
}
+
+ LI->addRange(LiveRange(StartIndex, EndIndex+1, ret));
}
// Memoize results so we don't have to recompute them.
@@ -810,10 +810,18 @@ bool PreAllocSplitting::Rematerialize(unsigned vreg, VNInfo* ValNo,
TII->reMaterialize(MBB, RestorePt, vreg, DefMI);
LIs->InsertMachineInstrInMaps(prior(RestorePt), RestoreIdx);
- ReconstructLiveInterval(CurrLI);
- unsigned RematIdx = LIs->getInstructionIndex(prior(RestorePt));
- RematIdx = LiveIntervals::getDefIndex(RematIdx);
- RenumberValno(CurrLI->findDefinedVNInfo(RematIdx));
+ if (KillPt->getParent() == BarrierMBB) {
+ VNInfo* After = UpdateRegisterInterval(ValNo, LIs->getUseIndex(KillIdx)+1,
+ LIs->getDefIndex(RestoreIdx));
+
+ RenumberValno(After);
+
+ ++NumSplits;
+ ++NumRemats;
+ return true;
+ }
+
+ RepairLiveInterval(CurrLI, ValNo, DefMI, RestoreIdx);
++NumSplits;
++NumRemats;
@@ -986,14 +994,28 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
MachineInstr *LoadMI = prior(RestorePt);
LIs->InsertMachineInstrInMaps(LoadMI, RestoreIndex);
+ // If live interval is spilled in the same block as the barrier, just
+ // create a hole in the interval.
+ if (!DefMBB ||
+ (SpillMI && SpillMI->getParent() == BarrierMBB)) {
+ // Update spill stack slot live interval.
+ UpdateSpillSlotInterval(ValNo, LIs->getUseIndex(SpillIndex)+1,
+ LIs->getDefIndex(RestoreIndex));
+
+ VNInfo* After = UpdateRegisterInterval(ValNo,
+ LIs->getUseIndex(SpillIndex)+1,
+ LIs->getDefIndex(RestoreIndex));
+ RenumberValno(After);
+
+ ++NumSplits;
+ return true;
+ }
+
// Update spill stack slot live interval.
UpdateSpillSlotInterval(ValNo, LIs->getUseIndex(SpillIndex)+1,
LIs->getDefIndex(RestoreIndex));
- ReconstructLiveInterval(CurrLI);
- unsigned RestoreIdx = LIs->getInstructionIndex(prior(RestorePt));
- RestoreIdx = LiveIntervals::getDefIndex(RestoreIdx);
- RenumberValno(CurrLI->findDefinedVNInfo(RestoreIdx));
+ RepairLiveInterval(CurrLI, ValNo, DefMI, RestoreIndex);
++NumSplits;
return true;