summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-04 02:48:56 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-04 02:48:56 +0000
commit2bc2a08b1bf6b5dcbfa515acc85999d6f884ec1a (patch)
tree734862ddd103af3867c96a1e2962ed8cc7ce419d /lib/Transforms
parenta0807f57caed954545661c23607c507f8d5c3d64 (diff)
downloadllvm-2bc2a08b1bf6b5dcbfa515acc85999d6f884ec1a.tar.gz
llvm-2bc2a08b1bf6b5dcbfa515acc85999d6f884ec1a.tar.bz2
llvm-2bc2a08b1bf6b5dcbfa515acc85999d6f884ec1a.tar.xz
DenseMap<uintptr_t,...> 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
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Utils/Local.cpp2
1 files changed, 2 insertions, 0 deletions
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<uintptr_t>(static_cast<Value *>(*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<DenseMap<uintptr_t, PHINode *>::iterator, bool> Pair =
HashMap.insert(std::make_pair(Hash, PN));