[llvm] [libsycl] Generic code cleanup (PR #224330)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 07:56:16 PDT 2026


================
@@ -91,33 +99,34 @@ void ProgramAndKernelManager::registerFatBin(const void *BinaryStart,
   DeviceImageManagerVec Images;
   Images.reserve(BinOrErr->size());
 
-  std::lock_guard<std::mutex> Guard(MDataCollectionMutex);
   for (std::unique_ptr<llvm::object::OffloadBinary> &OB : *BinOrErr) {
     if (!checkDeviceImageValidity(*OB))
       throw sycl::exception(sycl::make_error_code(sycl::errc::runtime),
                             "Incompatible device image.");
 
-    llvm::StringRef Symbols = OB->getString("symbols");
-
     Images.push_back(std::make_unique<DeviceImageManager>(std::move(OB)));
-    DeviceImageManager &NewImageWrapper = *Images.back();
-
-    llvm::offloading::sycl::forEachSymbol(Symbols, [&](llvm::StringRef Name) {
-      auto It = MDeviceKernelInfoMap.find(std::string_view(Name));
-      if (It == MDeviceKernelInfoMap.end()) {
-        [[maybe_unused]] auto [Iterator, EmplaceSucceeded] =
-            MDeviceKernelInfoMap.emplace(
-                std::piecewise_construct,
-                std::forward_as_tuple(std::string_view(Name)),
-                std::forward_as_tuple(std::string_view(Name), NewImageWrapper));
-        assert(EmplaceSucceeded && "Kernel name found in multiple images");
-      }
-    });
   }
 
-  [[maybe_unused]] auto [It, Inserted] =
+  std::lock_guard<std::mutex> Guard(MDataCollectionMutex);
----------------
KseniyaTikhomirova wrote:

published in https://github.com/llvm/llvm-project/pull/228099

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


More information about the llvm-commits mailing list