diff options
author | Johannes Doerfert <johannes@jdoerfert.de> | 2023-12-06 14:48:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-06 14:48:23 -0800 |
commit | d552ce263839ea92ae6bc5d05cf5e20b711019d1 (patch) | |
tree | 5ae419052954b953a6e8243ce8790fafadac9ae7 /openmp | |
parent | 71be8f3c23497e28c86f1135f564b16106d8d6fb (diff) | |
download | llvm-d552ce263839ea92ae6bc5d05cf5e20b711019d1.zip llvm-d552ce263839ea92ae6bc5d05cf5e20b711019d1.tar.gz llvm-d552ce263839ea92ae6bc5d05cf5e20b711019d1.tar.bz2 |
[OpenMP][NFC] Remove `DelayedBinDesc` (#74360)
Remove `DelayedBinDesc` as it is not necessary since
https://github.com/llvm/llvm-project/commit/bc4e0c048aa3cd940b0cea787014c7e8680e5040.
See
https://github.com/llvm/llvm-project/pull/74360#issuecomment-1843603736
for details.
Diffstat (limited to 'openmp')
-rw-r--r-- | openmp/libomptarget/include/PluginManager.h | 21 | ||||
-rw-r--r-- | openmp/libomptarget/src/interface.cpp | 3 | ||||
-rw-r--r-- | openmp/libomptarget/src/rtl.cpp | 1 | ||||
-rw-r--r-- | openmp/libomptarget/test/Inputs/empty.c | 1 | ||||
-rw-r--r-- | openmp/libomptarget/test/offloading/bug60119.c | 6 |
5 files changed, 7 insertions, 25 deletions
diff --git a/openmp/libomptarget/include/PluginManager.h b/openmp/libomptarget/include/PluginManager.h index 0b09747..6af99ef 100644 --- a/openmp/libomptarget/include/PluginManager.h +++ b/openmp/libomptarget/include/PluginManager.h @@ -150,24 +150,6 @@ struct PluginManager { HostPtrToTableMapTy HostPtrToTableMap; std::mutex TblMapMtx; ///< For HostPtrToTableMap - // Work around for plugins that call dlopen on shared libraries that call - // tgt_register_lib during their initialisation. Stash the pointers in a - // vector until the plugins are all initialised and then register them. - bool delayRegisterLib(__tgt_bin_desc *Desc) { - if (RTLsLoaded) - return false; - DelayedBinDesc.push_back(Desc); - return true; - } - - void registerDelayedLibraries() { - // Only called by libomptarget constructor - RTLsLoaded = true; - for (auto *Desc : DelayedBinDesc) - __tgt_register_lib(Desc); - DelayedBinDesc.clear(); - } - /// Return the number of usable devices. int getNumDevices() { return getExclusiveDevicesAccessor()->size(); } @@ -196,9 +178,6 @@ struct PluginManager { void addRequirements(int64_t Flags) { Requirements.addRequirements(Flags); } private: - bool RTLsLoaded = false; - llvm::SmallVector<__tgt_bin_desc *> DelayedBinDesc; - // List of all plugin adaptors, in use or not. llvm::SmallVector<std::unique_ptr<PluginAdaptorTy>> PluginAdaptors; diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp index d92f40c..777dc07 100644 --- a/openmp/libomptarget/src/interface.cpp +++ b/openmp/libomptarget/src/interface.cpp @@ -46,9 +46,6 @@ EXTERN void __tgt_register_requires(int64_t Flags) { /// adds a target shared library to the target execution image EXTERN void __tgt_register_lib(__tgt_bin_desc *Desc) { TIMESCOPE(); - if (PM->delayRegisterLib(Desc)) - return; - PM->registerLib(Desc); } diff --git a/openmp/libomptarget/src/rtl.cpp b/openmp/libomptarget/src/rtl.cpp index 5eb1c55..27db703 100644 --- a/openmp/libomptarget/src/rtl.cpp +++ b/openmp/libomptarget/src/rtl.cpp @@ -51,7 +51,6 @@ __attribute__((constructor(101))) void init() { PM->init(); Profiler::get(); - PM->registerDelayedLibraries(); } __attribute__((destructor(101))) void deinit() { diff --git a/openmp/libomptarget/test/Inputs/empty.c b/openmp/libomptarget/test/Inputs/empty.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/openmp/libomptarget/test/Inputs/empty.c @@ -0,0 +1 @@ + diff --git a/openmp/libomptarget/test/offloading/bug60119.c b/openmp/libomptarget/test/offloading/bug60119.c new file mode 100644 index 0000000..e32f1cc --- /dev/null +++ b/openmp/libomptarget/test/offloading/bug60119.c @@ -0,0 +1,6 @@ +// RUN: %clang-generic -fPIC -shared %S/../Inputs/empty.c -o %T/liba.so +// RUN: %clang-generic -fPIC -shared %S/../Inputs/empty.c -o %T/libb.so +// RUN: %clang-generic -rpath %T -L %T -l a -l b %s -o %t +// RUN: %t + +int main() {} |