VNInfos don't need to be destructed anymore.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 26 Jun 2010 11:30:59 +0000 (11:30 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 26 Jun 2010 11:30:59 +0000 (11:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106943 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveInterval.h
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/LiveStackAnalysis.cpp

index 94b81062236b7d78148dd1ecc89498fbc0c72908..5c1a7ec5646beece40d9f51ad75e7131748e0604 100644 (file)
@@ -67,7 +67,7 @@ namespace llvm {
     } cr;
 
   public:
-    typedef SpecificBumpPtrAllocator<VNInfo> Allocator;
+    typedef BumpPtrAllocator Allocator;
 
     /// The ID number of this value.
     unsigned id;
@@ -319,8 +319,8 @@ namespace llvm {
     /// the instruction that defines the value number.
     VNInfo *getNextValue(SlotIndex def, MachineInstr *CopyMI,
                        bool isDefAccurate, VNInfo::Allocator &VNInfoAllocator) {
-      VNInfo *VNI = VNInfoAllocator.Allocate();
-      new (VNI) VNInfo((unsigned)valnos.size(), def, CopyMI);
+      VNInfo *VNI =
+        new (VNInfoAllocator) VNInfo((unsigned)valnos.size(), def, CopyMI);
       VNI->setIsDefAccurate(isDefAccurate);
       valnos.push_back(VNI);
       return VNI;
@@ -330,8 +330,8 @@ namespace llvm {
     /// for the Value number.
     VNInfo *createValueCopy(const VNInfo *orig,
                             VNInfo::Allocator &VNInfoAllocator) {
-      VNInfo *VNI = VNInfoAllocator.Allocate();
-      new (VNI) VNInfo((unsigned)valnos.size(), *orig);
+      VNInfo *VNI =
+        new (VNInfoAllocator) VNInfo((unsigned)valnos.size(), *orig);
       valnos.push_back(VNI);
       return VNI;
     }
index fbf2833756ee300894ee9c079791b51176b5d3be..5f5aa3b203f9e003e577b1330cc79b997cff442a 100644 (file)
@@ -87,8 +87,8 @@ void LiveIntervals::releaseMemory() {
   
   r2iMap_.clear();
 
-  // Release VNInfo memroy regions after all VNInfo objects are dtor'd.
-  VNInfoAllocator.DestroyAll();
+  // Release VNInfo memory regions, VNInfo objects don't need to be dtor'd.
+  VNInfoAllocator.Reset();
   while (!CloneMIs.empty()) {
     MachineInstr *MI = CloneMIs.back();
     CloneMIs.pop_back();
index 798b9b939cd356e25b830d0b1da446a844681462..709e2c6d5ca7e79149f5434eab4b168273e2c673 100644 (file)
@@ -35,8 +35,8 @@ void LiveStacks::getAnalysisUsage(AnalysisUsage &AU) const {
 }
 
 void LiveStacks::releaseMemory() {
-  // Release VNInfo memroy regions after all VNInfo objects are dtor'd.
-  VNInfoAllocator.DestroyAll();
+  // Release VNInfo memory regions, VNInfo objects don't need to be dtor'd.
+  VNInfoAllocator.Reset();
   S2IMap.clear();
   S2RCMap.clear();
 }