mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-10 06:25:01 +00:00
Make the heuristic for shrinking DenseMap smarter.
llvm-svn: 40114
This commit is contained in:
parent
133b5cb6b6
commit
2ceefaf94d
@ -15,6 +15,7 @@
|
|||||||
#define LLVM_ADT_DENSEMAP_H
|
#define LLVM_ADT_DENSEMAP_H
|
||||||
|
|
||||||
#include "llvm/Support/DataTypes.h"
|
#include "llvm/Support/DataTypes.h"
|
||||||
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@ -300,8 +301,9 @@ private:
|
|||||||
unsigned OldNumBuckets = NumBuckets;
|
unsigned OldNumBuckets = NumBuckets;
|
||||||
BucketT *OldBuckets = Buckets;
|
BucketT *OldBuckets = Buckets;
|
||||||
|
|
||||||
// Halve the number of buckets.
|
// Reduce the number of buckets.
|
||||||
NumBuckets >>= 1;
|
NumBuckets = NumEntries > 32 ? 1 << (Log2_32_Ceil(NumEntries) + 1)
|
||||||
|
: 64;
|
||||||
NumTombstones = 0;
|
NumTombstones = 0;
|
||||||
Buckets = (BucketT*)new char[sizeof(BucketT)*NumBuckets];
|
Buckets = (BucketT*)new char[sizeof(BucketT)*NumBuckets];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user