From 413f7d90dbfd209f3c4af43eec88f7ebc73ba356 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. llvm-svn: 52819 --- llvm/lib/CodeGen/LiveVariables.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/LiveVariables.cpp') diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index f3a92f2f1c8..ab73c97ec9e 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 @@ -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