summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-01-03 04:07:46 +0000
committerCameron Zwarich <zwarich@apple.com>2011-01-03 04:07:46 +0000
commit53eeba586dac8a25db63fe02a00ef10feb8b3925 (patch)
tree50fdb8d3ff37bc6955d02a53c6695e6b7174d796 /lib/CodeGen/MachineCSE.cpp
parent041ee7e6fa1a04e64371ece9225a984d9a6bdf4b (diff)
downloadllvm-53eeba586dac8a25db63fe02a00ef10feb8b3925.tar.gz
llvm-53eeba586dac8a25db63fe02a00ef10feb8b3925.tar.bz2
llvm-53eeba586dac8a25db63fe02a00ef10feb8b3925.tar.xz
Use a RecyclingAllocator to allocate values for MachineCSE's ScopedHashTable for
a 28% speedup of MachineCSE time on 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineCSE.cpp')
-rw-r--r--lib/CodeGen/MachineCSE.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineCSE.cpp b/lib/CodeGen/MachineCSE.cpp
index fc3f5943d7..bb1db86658 100644
--- a/lib/CodeGen/MachineCSE.cpp
+++ b/lib/CodeGen/MachineCSE.cpp
@@ -25,6 +25,7 @@
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/RecyclingAllocator.h"
using namespace llvm;
@@ -65,10 +66,13 @@ namespace {
private:
const unsigned LookAheadLimit;
- typedef ScopedHashTableScope<MachineInstr*, unsigned,
- MachineInstrExpressionTrait> ScopeType;
+ typedef RecyclingAllocator<BumpPtrAllocator,
+ ScopedHashTableVal<MachineInstr*, unsigned> > AllocatorTy;
+ typedef ScopedHashTable<MachineInstr*, unsigned,
+ MachineInstrExpressionTrait, AllocatorTy> ScopedHTType;
+ typedef ScopedHTType::ScopeTy ScopeType;
DenseMap<MachineBasicBlock*, ScopeType*> ScopeMap;
- ScopedHashTable<MachineInstr*, unsigned, MachineInstrExpressionTrait> VNT;
+ ScopedHTType VNT;
SmallVector<MachineInstr*, 64> Exps;
unsigned CurrVN;