[Openmp-commits] [PATCH] D142008: [libomptarget] Delay recursive shared library registrations until offload RTLs are loaded

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 18 15:58:17 PST 2023


jdoerfert added a comment.

In D142008#4062757 <https://reviews.llvm.org/D142008#4062757>, @Maetveis wrote:

> I think you're missing some of the changes, I should have added a loop around the registration of the library to the plugins that goes over `DelayedDescs` and registers each, maybe it did not upload right?

OK. I'll start to understand. Now let's clean this up and fix something we should not need to fix.

See inline comments.



================
Comment at: openmp/libomptarget/include/rtl.h:157
 
+  static thread_local llvm::SmallVector<__tgt_bin_desc*> DelayedDescs;
+
----------------
Let's move this into the PluginManager without static and without thread_local. Also, consider a small ptr set to avoid the linear search.


================
Comment at: openmp/libomptarget/src/interface.cpp:21
 
+#include "llvm/ADT/ScopeExit.h"
+#include "llvm/ADT/SmallVector.h"
----------------
Not needed?


================
Comment at: openmp/libomptarget/src/interface.cpp:47-49
+  if(RTLsTy::DelayedDescs.size() > 1) {
+    return;
+  }
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142008/new/

https://reviews.llvm.org/D142008



More information about the Openmp-commits mailing list