[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp

Chris Lattner sabre at nondot.org
Mon Jan 22 17:00:04 PST 2007



Changes in directory llvm/lib/CodeGen:

VirtRegMap.cpp updated: 1.93 -> 1.94
---
Log message:

Switch this to use SmallSet to avoid mallocs in the common case.


---
Diffs of the changes:  (+3 -3)

 VirtRegMap.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/lib/CodeGen/VirtRegMap.cpp
diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.93 llvm/lib/CodeGen/VirtRegMap.cpp:1.94
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.93	Fri Jan 19 16:40:14 2007
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Mon Jan 22 18:59:48 2007
@@ -29,8 +29,8 @@
 #include "llvm/Support/Compiler.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallSet.h"
 #include <algorithm>
-#include <set>
 using namespace llvm;
 
 STATISTIC(NumSpills, "Number of register spills");
@@ -471,7 +471,7 @@
     unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI,
                              AvailableSpills &Spills,
                              std::map<int, MachineInstr*> &MaybeDeadStores,
-                             std::set<unsigned> &Rejected) {
+                             SmallSet<unsigned, 8> &Rejected) {
       if (Reuses.empty()) return PhysReg;  // This is most often empty.
 
       for (unsigned ro = 0, e = Reuses.size(); ro != e; ++ro) {
@@ -553,7 +553,7 @@
     unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI,
                              AvailableSpills &Spills,
                              std::map<int, MachineInstr*> &MaybeDeadStores) {
-      std::set<unsigned> Rejected;
+      SmallSet<unsigned, 8> Rejected;
       return GetRegForReload(PhysReg, MI, Spills, MaybeDeadStores, Rejected);
     }
   };






More information about the llvm-commits mailing list