Skip to content

Commit d552ce2

Browse files
authored
[OpenMP][NFC] Remove DelayedBinDesc (#74360)
Remove `DelayedBinDesc` as it is not necessary since bc4e0c0. See #74360 (comment) for details.
1 parent 71be8f3 commit d552ce2

File tree

5 files changed

+7
-25
lines changed

5 files changed

+7
-25
lines changed

openmp/libomptarget/include/PluginManager.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -150,24 +150,6 @@ struct PluginManager {
150150
HostPtrToTableMapTy HostPtrToTableMap;
151151
std::mutex TblMapMtx; ///< For HostPtrToTableMap
152152

153-
// Work around for plugins that call dlopen on shared libraries that call
154-
// tgt_register_lib during their initialisation. Stash the pointers in a
155-
// vector until the plugins are all initialised and then register them.
156-
bool delayRegisterLib(__tgt_bin_desc *Desc) {
157-
if (RTLsLoaded)
158-
return false;
159-
DelayedBinDesc.push_back(Desc);
160-
return true;
161-
}
162-
163-
void registerDelayedLibraries() {
164-
// Only called by libomptarget constructor
165-
RTLsLoaded = true;
166-
for (auto *Desc : DelayedBinDesc)
167-
__tgt_register_lib(Desc);
168-
DelayedBinDesc.clear();
169-
}
170-
171153
/// Return the number of usable devices.
172154
int getNumDevices() { return getExclusiveDevicesAccessor()->size(); }
173155

@@ -196,9 +178,6 @@ struct PluginManager {
196178
void addRequirements(int64_t Flags) { Requirements.addRequirements(Flags); }
197179

198180
private:
199-
bool RTLsLoaded = false;
200-
llvm::SmallVector<__tgt_bin_desc *> DelayedBinDesc;
201-
202181
// List of all plugin adaptors, in use or not.
203182
llvm::SmallVector<std::unique_ptr<PluginAdaptorTy>> PluginAdaptors;
204183

openmp/libomptarget/src/interface.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ EXTERN void __tgt_register_requires(int64_t Flags) {
4646
/// adds a target shared library to the target execution image
4747
EXTERN void __tgt_register_lib(__tgt_bin_desc *Desc) {
4848
TIMESCOPE();
49-
if (PM->delayRegisterLib(Desc))
50-
return;
51-
5249
PM->registerLib(Desc);
5350
}
5451

openmp/libomptarget/src/rtl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ __attribute__((constructor(101))) void init() {
5151
PM->init();
5252

5353
Profiler::get();
54-
PM->registerDelayedLibraries();
5554
}
5655

5756
__attribute__((destructor(101))) void deinit() {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang-generic -fPIC -shared %S/../Inputs/empty.c -o %T/liba.so
2+
// RUN: %clang-generic -fPIC -shared %S/../Inputs/empty.c -o %T/libb.so
3+
// RUN: %clang-generic -rpath %T -L %T -l a -l b %s -o %t
4+
// RUN: %t
5+
6+
int main() {}

0 commit comments

Comments
 (0)