[llvm] [Offload] Cache symbols in program (PR #148209)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 08:14:26 PDT 2025


================
@@ -714,6 +716,18 @@ Error olGetSymbol_impl(ol_program_handle_t Program, const char *Name,
                        ol_symbol_kind_t Kind, ol_symbol_handle_t *Symbol) {
   auto &Device = Program->Image->getDevice();
 
+  std::lock_guard<std::mutex> Lock{Program->SymbolListMutex};
+
+  // If it already exists, return an existing handle
+  auto Check = std::find_if(
----------------
jhuber6 wrote:

Shouldn't we just have `contains()`? If not, use the `llvm::find_if` at least.

https://github.com/llvm/llvm-project/pull/148209


More information about the llvm-commits mailing list