From bffdf66b8050b45188cb265f27e81c41277ab0ca Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 27 Jun 2008 07:05:59 +0000 Subject: 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 --- lib/CodeGen/LiveVariables.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/LiveVariables.cpp') diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index f3a92f2f1c..ab73c97ec9 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 @@ -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 Live; + SmallSet Live; if (PhysRegDef[Reg] || PhysRegUse[Reg]) { Live.insert(Reg); for (const unsigned *SS = TRI->getSubRegisters(Reg); *SS; ++SS) -- cgit v1.2.3