diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-03-04 02:48:56 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-03-04 02:48:56 +0000 |
commit | e2017b6f2ef1622089c140f1f6f0552e5a146e13 (patch) | |
tree | cfe474a6ee08a8ff30c75ce6224ed961cda7c42b /llvm/lib | |
parent | c88b7ecb88267be1c53ec7a56352db3ffb572210 (diff) | |
download | bcm5719-llvm-e2017b6f2ef1622089c140f1f6f0552e5a146e13.tar.gz bcm5719-llvm-e2017b6f2ef1622089c140f1f6f0552e5a146e13.zip |
DenseMap<uintptr_t,...> doesn't allow all values as keys.
Avoid colliding with the sentinels, hopefully unbreaking
llvm-gcc-x86_64-linux-selfhost.
llvm-svn: 126982
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 3f789fa8658..32a50b80cd5 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/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)); |