diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-18 21:13:27 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-18 21:13:27 +0000 |
commit | b5fa9333431673aac2ced8dea80152349a85cf6f (patch) | |
tree | e7d6a2a04137bec83640ed9f89766b702048d573 /lib/CodeGen/SplitKit.cpp | |
parent | fdcee77887372dbf6589d47cc33094965b679f24 (diff) |
Add RAGreedy methods for splitting live ranges around regions.
Analyze the live range's behavior entering and leaving basic blocks. Compute an
interference pattern for each allocation candidate, and use SpillPlacement to
find an optimal region where that register can be live.
This code is still not enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.cpp')
-rw-r--r-- | lib/CodeGen/SplitKit.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp index 4bb13e44b8..7ed9089ecd 100644 --- a/lib/CodeGen/SplitKit.cpp +++ b/lib/CodeGen/SplitKit.cpp @@ -48,6 +48,7 @@ SplitAnalysis::SplitAnalysis(const MachineFunction &mf, curli_(0) {} void SplitAnalysis::clear() { + UseSlots.clear(); usingInstrs_.clear(); usingBlocks_.clear(); usingLoops_.clear(); @@ -67,6 +68,7 @@ void SplitAnalysis::analyzeUses() { MachineInstr *MI = I.skipInstruction();) { if (MI->isDebugValue() || !usingInstrs_.insert(MI)) continue; + UseSlots.push_back(lis_.getInstructionIndex(MI).getDefIndex()); MachineBasicBlock *MBB = MI->getParent(); if (usingBlocks_[MBB]++) continue; @@ -74,6 +76,7 @@ void SplitAnalysis::analyzeUses() { Loop = Loop->getParentLoop()) usingLoops_[Loop]++; } + array_pod_sort(UseSlots.begin(), UseSlots.end()); DEBUG(dbgs() << " counted " << usingInstrs_.size() << " instrs, " << usingBlocks_.size() << " blocks, " |