Use a DenseMap instead of an std::map for mangled name lookup. This is
authorOwen Anderson <resistor@mac.com>
Thu, 26 Jun 2008 17:20:16 +0000 (17:20 +0000)
committerOwen Anderson <resistor@mac.com>
Thu, 26 Jun 2008 17:20:16 +0000 (17:20 +0000)
improves AsmPrinter runtime on instcombine from 0.3920s to 0.3836s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52787 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Mangler.h

index 39ac26dd1bf2bcc47dac746e30ef8a60f6a0329b..0a7b33a2327b2e8bfe2be15228b49114747dec3e 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_MANGLER_H
 #define LLVM_SUPPORT_MANGLER_H
 
+#include "llvm/ADT/DenseMap.h"
 #include <map>
 #include <set>
 #include <string>
@@ -40,7 +41,7 @@ class Mangler {
   
   /// Memo - This is used to remember the name that we assign a value.
   ///
-  std::map<const Value*, std::string> Memo;
+  DenseMap<const Value*, std::string> Memo;
 
   /// Count - This simple counter is used to unique value names.
   ///