LLVM 22.0.0git
llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info > Class Template Reference

#include "llvm/ADT/ConcurrentHashtable.h"

Inheritance diagram for llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >:
[legend]

Classes

struct  Bucket

Public Member Functions

 ConcurrentHashTableByPtr (AllocatorTy &Allocator, uint64_t EstimatedSize=100000, size_t ThreadsNum=parallel::strategy.compute_thread_count(), size_t InitialNumberOfBuckets=128)
virtual ~ConcurrentHashTableByPtr ()
std::pair< KeyDataTy *, boolinsert (const KeyTy &NewValue)
 Insert new value NewValue or return already existing entry.
void printStatistic (raw_ostream &OS)
 Print information about current state of hash table structures.

Protected Types

using ExtHashBitsTy = uint32_t
using EntryDataTy = KeyDataTy *
using HashesPtr = ExtHashBitsTy *
using DataPtr = EntryDataTy *

Protected Member Functions

void RehashBucket (Bucket &CurBucket)
uint32_t getBucketIdx (hash_code Hash)
uint32_t getExtHashBits (uint64_t Hash)
uint32_t getStartIdx (uint32_t ExtHashBits, uint32_t BucketSize)

Protected Attributes

uint64_t HashBitsNum = 0
uint64_t HashMask = 0
uint64_t ExtHashMask = 0
uint32_t MaxBucketSize = 0
uint32_t InitialBucketSize = 0
uint32_t NumberOfBuckets = 0
std::unique_ptr< Bucket[]> BucketsArray
AllocatorTy & MultiThreadAllocator

Detailed Description

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
class llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >

Definition at line 102 of file ConcurrentHashtable.h.

Member Typedef Documentation

◆ DataPtr

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
using llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::DataPtr = EntryDataTy *
protected

Definition at line 274 of file ConcurrentHashtable.h.

◆ EntryDataTy

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
using llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::EntryDataTy = KeyDataTy *
protected

Definition at line 271 of file ConcurrentHashtable.h.

◆ ExtHashBitsTy

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
using llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::ExtHashBitsTy = uint32_t
protected

Definition at line 270 of file ConcurrentHashtable.h.

◆ HashesPtr

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
using llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::HashesPtr = ExtHashBitsTy *
protected

Definition at line 273 of file ConcurrentHashtable.h.

Constructor & Destructor Documentation

◆ ConcurrentHashTableByPtr()

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::ConcurrentHashTableByPtr ( AllocatorTy & Allocator,
uint64_t EstimatedSize = 100000,
size_t ThreadsNum = parallel::strategy.compute_thread_count(),
size_t InitialNumberOfBuckets = 128 )
inline

◆ ~ConcurrentHashTableByPtr()

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
virtual llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::~ConcurrentHashTableByPtr ( )
inlinevirtual

Definition at line 160 of file ConcurrentHashtable.h.

References BucketsArray, and NumberOfBuckets.

Member Function Documentation

◆ getBucketIdx()

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint32_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::getBucketIdx ( hash_code Hash)
inlineprotected

Definition at line 362 of file ConcurrentHashtable.h.

References HashMask.

Referenced by insert().

◆ getExtHashBits()

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint32_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::getExtHashBits ( uint64_t Hash)
inlineprotected

Definition at line 364 of file ConcurrentHashtable.h.

References ExtHashMask, and HashBitsNum.

Referenced by insert().

◆ getStartIdx()

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint32_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::getStartIdx ( uint32_t ExtHashBits,
uint32_t BucketSize )
inlineprotected

Definition at line 368 of file ConcurrentHashtable.h.

References assert().

Referenced by insert(), and RehashBucket().

◆ insert()

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
std::pair< KeyDataTy *, bool > llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::insert ( const KeyTy & NewValue)
inline

◆ printStatistic()

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
void llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::printStatistic ( raw_ostream & OS)
inline

◆ RehashBucket()

Member Data Documentation

◆ BucketsArray

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
std::unique_ptr<Bucket[]> llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::BucketsArray
protected

◆ ExtHashMask

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint64_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::ExtHashMask = 0
protected

Definition at line 381 of file ConcurrentHashtable.h.

Referenced by ConcurrentHashTableByPtr(), and getExtHashBits().

◆ HashBitsNum

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint64_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::HashBitsNum = 0
protected

Definition at line 375 of file ConcurrentHashtable.h.

Referenced by ConcurrentHashTableByPtr(), and getExtHashBits().

◆ HashMask

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint64_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::HashMask = 0
protected

Definition at line 378 of file ConcurrentHashtable.h.

Referenced by ConcurrentHashTableByPtr(), and getBucketIdx().

◆ InitialBucketSize

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint32_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::InitialBucketSize = 0
protected

Definition at line 387 of file ConcurrentHashtable.h.

Referenced by ConcurrentHashTableByPtr(), and printStatistic().

◆ MaxBucketSize

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint32_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::MaxBucketSize = 0
protected

Definition at line 384 of file ConcurrentHashtable.h.

Referenced by ConcurrentHashTableByPtr(), and RehashBucket().

◆ MultiThreadAllocator

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
AllocatorTy& llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::MultiThreadAllocator
protected

Definition at line 396 of file ConcurrentHashtable.h.

Referenced by ConcurrentHashTableByPtr(), and insert().

◆ NumberOfBuckets

template<typename KeyTy, typename KeyDataTy, typename AllocatorTy, typename Info = ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
uint32_t llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::NumberOfBuckets = 0
protected

The documentation for this class was generated from the following file: