diff options
author | Owen Anderson <resistor@mac.com> | 2008-06-27 07:05:59 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-06-27 07:05:59 +0000 |
commit | 413f7d90dbfd209f3c4af43eec88f7ebc73ba356 (patch) | |
tree | c2095dcb4e5f8b63002e5cad097ef94e62d391b7 /llvm/lib/CodeGen/LiveVariables.cpp | |
parent | 4f024862f6338105f6510e057c856c1ae2051afb (diff) | |
download | llvm-413f7d90dbfd209f3c4af43eec88f7ebc73ba356.zip llvm-413f7d90dbfd209f3c4af43eec88f7ebc73ba356.tar.gz llvm-413f7d90dbfd209f3c4af43eec88f7ebc73ba356.tar.bz2 |
Use a SmallSet when we can to reduce memory allocations.
This speeds up a particular testcase from 0.0302s to 0.0222s in LiveVariables.
llvm-svn: 52819
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveVariables.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index f3a92f2..ab73c97 100644 --- a/llvm/lib/CodeGen/LiveVariables.cpp +++ b/llvm/lib/CodeGen/LiveVariables.cpp @@ -34,6 +34,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Config/alloca.h" #include <algorithm> @@ -387,7 +388,7 @@ bool LiveVariables::HandlePhysRegKill(unsigned Reg) { void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) { // What parts of the register are previously defined? - std::set<unsigned> Live; + SmallSet<unsigned, 32> Live; if (PhysRegDef[Reg] || PhysRegUse[Reg]) { Live.insert(Reg); for (const unsigned *SS = TRI->getSubRegisters(Reg); *SS; ++SS) |