Switch mem2reg to use the new hashing infrastructure.
authorChandler Carruth <chandlerc@gmail.com>
Mon, 5 Mar 2012 11:29:56 +0000 (11:29 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 5 Mar 2012 11:29:56 +0000 (11:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152026 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/PromoteMemoryToRegister.cpp

index e504123f0460557a2ac0842f5204ef6b718036e8..2357d81916a4577840b5370c6f0da40643986dae 100644 (file)
@@ -41,6 +41,7 @@
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/Statistic.h"
@@ -66,7 +67,8 @@ struct DenseMapInfo<std::pair<BasicBlock*, unsigned> > {
     return EltTy(reinterpret_cast<BasicBlock*>(-2), 0U);
   }
   static unsigned getHashValue(const std::pair<BasicBlock*, unsigned> &Val) {
-    return DenseMapInfo<void*>::getHashValue(Val.first) + Val.second*2;
+    using llvm::hash_value;
+    return static_cast<unsigned>(hash_value(Val));
   }
   static bool isEqual(const EltTy &LHS, const EltTy &RHS) {
     return LHS == RHS;