aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SplitKit.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-18 21:13:27 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-18 21:13:27 +0000
commitb5fa9333431673aac2ced8dea80152349a85cf6f (patch)
treee7d6a2a04137bec83640ed9f89766b702048d573 /lib/CodeGen/SplitKit.cpp
parentfdcee77887372dbf6589d47cc33094965b679f24 (diff)
downloadexternal_llvm-b5fa9333431673aac2ced8dea80152349a85cf6f.zip
external_llvm-b5fa9333431673aac2ced8dea80152349a85cf6f.tar.gz
external_llvm-b5fa9333431673aac2ced8dea80152349a85cf6f.tar.bz2
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.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp
index 4bb13e4..7ed9089 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, "