From 2bc2a08b1bf6b5dcbfa515acc85999d6f884ec1a Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 4 Mar 2011 02:48:56 +0000 Subject: DenseMap doesn't allow all values as keys. Avoid colliding with the sentinels, hopefully unbreaking llvm-gcc-x86_64-linux-selfhost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126982 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/Local.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Transforms/Utils/Local.cpp') diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 3f789fa865..32a50b80cd 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -632,6 +632,8 @@ bool llvm::EliminateDuplicatePHINodes(BasicBlock *BB) { Hash ^= reinterpret_cast(static_cast(*I)); Hash = (Hash << 7) | (Hash >> (sizeof(uintptr_t) * CHAR_BIT - 7)); } + // Avoid colliding with the DenseMap sentinels ~0 and ~0-1. + Hash >>= 1; // If we've never seen this hash value before, it's a unique PHI. std::pair::iterator, bool> Pair = HashMap.insert(std::make_pair(Hash, PN)); -- cgit v1.2.3-18-g5258