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 | bffdf66b8050b45188cb265f27e81c41277ab0ca (patch) | |
tree | 80ea95ce74b8f224b822be72856d10017d53d1c0 /lib | |
parent | 1360b7d8f8d1969026870d18c582b4e3a7cff8b8 (diff) | |
download | external_llvm-bffdf66b8050b45188cb265f27e81c41277ab0ca.zip external_llvm-bffdf66b8050b45188cb265f27e81c41277ab0ca.tar.gz external_llvm-bffdf66b8050b45188cb265f27e81c41277ab0ca.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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index f3a92f2..ab73c97 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/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) |