9#ifndef LLVM_SUPPORT_PERTHREADBUMPPTRALLOCATOR_H
10#define LLVM_SUPPORT_PERTHREADBUMPPTRALLOCATOR_H
26template <
typename AllocatorTy>
77 size_t TotalMemory = 0;
87 size_t BytesAllocated = 0;
92 return BytesAllocated;
104 errs() <<
"\n Allocator " <<
Idx <<
"\n";
This file defines the BumpPtrAllocator interface.
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
CRTP base class providing obvious overloads for the core Allocate() methods of LLVM-style allocators.
PerThreadAllocator is used in conjunction with ThreadPoolExecutor to allow per-thread allocations.
std::unique_ptr< AllocatorTy[]> Allocators
size_t getNumberOfAllocators() const
size_t getTotalMemory() const
Return total memory size used by all allocators.
void Deallocate(const void *Ptr, size_t Size, size_t Alignment)
Deallocate Ptr to Size bytes of memory allocated by this allocator.
size_t getBytesAllocated() const
Return allocated size by all allocators.
void Reset()
Reset state of allocators.
void * Allocate(size_t Size, size_t Alignment)
Allocate Size bytes of Alignment aligned memory.
void PrintStats() const
Print statistic for each allocator.
AllocatorTy & getThreadLocalAllocator()
Return allocator corresponding to the current thread.
void setRedZoneSize(size_t NewSize)
Set red zone for all allocators.
unsigned getThreadIndex()
PerThreadAllocator< BumpPtrAllocator > PerThreadBumpPtrAllocator
This is an optimization pass for GlobalISel generic memory operations.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Implement std::hash so that hash_code can be used in STL containers.