Switch LiveIntervalUnion from std::set to IntervalMap.

This speeds up RegAllocBasic by 20%, not counting releaseMemory which becomes
way faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121201 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/RegAllocBase.h b/lib/CodeGen/RegAllocBase.h
index 8044a19..32f5e08 100644
--- a/lib/CodeGen/RegAllocBase.h
+++ b/lib/CodeGen/RegAllocBase.h
@@ -38,6 +38,7 @@
 #define LLVM_CODEGEN_REGALLOCBASE
 
 #include "llvm/ADT/OwningPtr.h"
+#include "LiveIntervalUnion.h"
 
 namespace llvm {
 
@@ -69,17 +70,19 @@
 /// live range splitting. LessSpillWeightPriority is provided as a standard
 /// comparator, but we may add an interface to override it if necessary.
 class RegAllocBase {
+  LiveIntervalUnion::Allocator UnionAllocator;
 protected:
   // Array of LiveIntervalUnions indexed by physical register.
   class LiveUnionArray {
     unsigned NumRegs;
-    OwningArrayPtr<LiveIntervalUnion> Array;
+    LiveIntervalUnion *Array;
   public:
-    LiveUnionArray(): NumRegs(0) {}
+    LiveUnionArray(): NumRegs(0), Array(0) {}
+    ~LiveUnionArray() { clear(); }
 
     unsigned numRegs() const { return NumRegs; }
 
-    void init(unsigned NRegs);
+    void init(LiveIntervalUnion::Allocator &, unsigned NRegs);
 
     void clear();