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.

llvm-svn: 123774
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index 4bb13e4..7ed9089 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -48,6 +48,7 @@
     curli_(0) {}
 
 void SplitAnalysis::clear() {
+  UseSlots.clear();
   usingInstrs_.clear();
   usingBlocks_.clear();
   usingLoops_.clear();
@@ -67,6 +68,7 @@
        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 @@
          Loop = Loop->getParentLoop())
       usingLoops_[Loop]++;
   }
+  array_pod_sort(UseSlots.begin(), UseSlots.end());
   DEBUG(dbgs() << "  counted "
                << usingInstrs_.size() << " instrs, "
                << usingBlocks_.size() << " blocks, "