Go to the documentation of this file.
13 #ifndef LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H
14 #define LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H
24 class SymbolStringPtr;
42 using RefCountType = std::atomic<size_t>;
45 mutable std::mutex PoolMutex;
60 if (isRealPoolEntry(
S))
65 if (isRealPoolEntry(
S)) {
66 assert(
S->getValue() &&
"Releasing SymbolStringPtr with zero ref count");
70 if (isRealPoolEntry(
S))
80 if (isRealPoolEntry(
S)) {
81 assert(
S->getValue() &&
"Releasing SymbolStringPtr with zero ref count");
90 if (isRealPoolEntry(
S)) {
91 assert(
S->getValue() &&
"Releasing SymbolStringPtr with zero ref count");
96 explicit operator bool()
const {
return S; }
117 using PoolEntryPtr = PoolEntry *;
121 if (isRealPoolEntry(
S))
126 bool isRealPoolEntry(PoolEntryPtr
P) {
127 return ((
reinterpret_cast<uintptr_t
>(
P) - 1) & InvalidPtrMask) !=
132 return SymbolStringPtr(
reinterpret_cast<PoolEntryPtr
>(EmptyBitPattern));
136 return SymbolStringPtr(
reinterpret_cast<PoolEntryPtr
>(TombstoneBitPattern));
139 constexpr
static uintptr_t EmptyBitPattern =
141 << PointerLikeTypeTraits<PoolEntryPtr>::NumLowBitsAvailable;
143 constexpr
static uintptr_t TombstoneBitPattern =
145 << PointerLikeTypeTraits<PoolEntryPtr>::NumLowBitsAvailable;
147 constexpr
static uintptr_t InvalidPtrMask =
149 << PointerLikeTypeTraits<PoolEntryPtr>::NumLowBitsAvailable;
151 PoolEntryPtr
S =
nullptr;
157 assert(Pool.
empty() &&
"Dangling references at pool destruction time");
162 std::lock_guard<std::mutex>
Lock(PoolMutex);
170 std::lock_guard<std::mutex>
Lock(PoolMutex);
173 if (Tmp->second == 0)
179 std::lock_guard<std::mutex>
Lock(PoolMutex);
189 return orc::SymbolStringPtr::getEmptyVal();
193 return orc::SymbolStringPtr::getTombstoneVal();
208 #endif // LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H
~SymbolStringPool()
Destroy a SymbolStringPool.
SymbolStringPtr(const SymbolStringPtr &Other)
This is an optimization pass for GlobalISel generic memory operations.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
SymbolStringPtr(SymbolStringPtr &&Other)
Pointer to a pooled string representing a symbol name.
static unsigned getHashValue(const orc::SymbolStringPtr &V)
friend bool operator==(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS)
bool empty() const
Returns true if the pool is empty.
An information struct used to provide DenseMap with the various necessary components for a given valu...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
SymbolStringPtr(std::nullptr_t)
String pool for symbol names used by the JIT.
static orc::SymbolStringPtr getTombstoneKey()
static orc::SymbolStringPtr getEmptyKey()
StringRef operator*() const
SymbolStringPtr & operator=(const SymbolStringPtr &Other)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
friend bool operator!=(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS)
StringRef - Represent a constant reference to a string, i.e.
friend class SymbolStringPtr
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
friend bool operator<(const SymbolStringPtr &LHS, const SymbolStringPtr &RHS)
SymbolStringPtr intern(StringRef S)
Create a symbol string pointer from the given string.
static bool isEqual(const orc::SymbolStringPtr &LHS, const orc::SymbolStringPtr &RHS)
Align max(MaybeAlign Lhs, Align Rhs)
void clearDeadEntries()
Remove from the pool any entries that are no longer referenced.
SymbolStringPtr & operator=(SymbolStringPtr &&Other)
SymbolStringPtr()=default
std::pair< iterator, bool > try_emplace(StringRef Key, ArgsTy &&... Args)
Emplace a new element for the specified key into the map if the key isn't already in the map.
Optional< std::vector< StOtherPiece > > Other