[Openmp-commits] [openmp] [OpenMP][NFC] Remove `DelayedBinDesc` (PR #74360)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 5 11:19:13 PST 2023


jdoerfert wrote:

> 
It wasn't dead when we wrote it. It stopped HSA segfaulting when running any openmp programs

Again, it was always dead, UB, or racy. My money is on dead. This is the code in your patch:

```
  PM = new PluginManager(UseEventsForAtomicTransfers);

  ProfileTraceFile = getenv("LIBOMPTARGET_PROFILE");
  // TODO: add a configuration option for time granularity
  if (ProfileTraceFile)
    timeTraceProfilerInitialize(500 /* us */, "libomptarget");

  PM->RTLs.loadRTLs();
  PM->registerDelayedLibraries();
```
There is no point between `PM = new` and `PM-> registerDelayedLibraries` at which someone could call `__tgt_register_lib` and thereby use the `DelayedBinDesc` in a well defined manner because they cannot synchronize with the thread that runs this code. Your patch removed the crash because it moved `PM->RTLs.loadRTLs();`, everything else was, and is, dead and not needed.

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


More information about the Openmp-commits mailing list