mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Make the heuristic for shrinking DenseMap smarter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40114 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
edbef38067
commit
398b40671b
@ -15,6 +15,7 @@
|
||||
#define LLVM_ADT_DENSEMAP_H
|
||||
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
@ -300,8 +301,9 @@ private:
|
||||
unsigned OldNumBuckets = NumBuckets;
|
||||
BucketT *OldBuckets = Buckets;
|
||||
|
||||
// Halve the number of buckets.
|
||||
NumBuckets >>= 1;
|
||||
// Reduce the number of buckets.
|
||||
NumBuckets = NumEntries > 32 ? 1 << (Log2_32_Ceil(NumEntries) + 1)
|
||||
: 64;
|
||||
NumTombstones = 0;
|
||||
Buckets = (BucketT*)new char[sizeof(BucketT)*NumBuckets];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user