From 2ccf7ed277df28651b94bbee9fccefdf22fb074f Mon Sep 17 00:00:00 2001 From: Jared Wyles Date: Fri, 6 Dec 2024 10:22:09 +1100 Subject: [JITLink] Switch to SymbolStringPtr for Symbol names (#115796) Use SymbolStringPtr for Symbol names in LinkGraph. This reduces string interning on the boundary between JITLink and ORC, and allows pointer comparisons (rather than string comparisons) between Symbol names. This should improve the performance and readability of code that bridges between JITLink and ORC (e.g. ObjectLinkingLayer and ObjectLinkingLayer::Plugins). To enable use of SymbolStringPtr a std::shared_ptr is added to LinkGraph and threaded through to its construction sites in LLVM and Bolt. All LinkGraphs that are to have symbol names compared by pointer equality must point to the same SymbolStringPool instance, which in ORC sessions should be the pool attached to the ExecutionSession. --------- Co-authored-by: Lang Hames --- llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp') diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp index 71221c2d3fce..0b2cafb0bff1 100644 --- a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp +++ b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp @@ -129,7 +129,7 @@ getELFObjectFileSymbolInfo(ExecutionSession &ES, if (Sym.getBinding() == ELF::STB_GNU_UNIQUE) *SymFlags |= JITSymbolFlags::Weak; - I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags); + I.SymbolFlags[ES.intern(std::move(*Name))] = std::move(*SymFlags); } SymbolStringPtr InitSymbol; -- cgit v1.2.3