llvm.org GIT mirror llvm / 398b406
Make the heuristic for shrinking DenseMap smarter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40114 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 12 years ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1414 #define LLVM_ADT_DENSEMAP_H
1515
1616 #include "llvm/Support/DataTypes.h"
17 #include "llvm/Support/MathExtras.h"
1718 #include
1819 #include
1920
299300 unsigned OldNumBuckets = NumBuckets;
300301 BucketT *OldBuckets = Buckets;
301302
302 // Halve the number of buckets.
303 NumBuckets >>= 1;
303 // Reduce the number of buckets.
304 NumBuckets = NumEntries > 32 ? 1 << (Log2_32_Ceil(NumEntries) + 1)
305 : 64;
304306 NumTombstones = 0;
305307 Buckets = (BucketT*)new char[sizeof(BucketT)*NumBuckets];
306308