aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-03-27 14:09:37 -0500
committerGitHub <noreply@github.com>2024-03-27 14:09:37 -0500
commit421085fd740d937559db068c0a1b354b033aca63 (patch)
tree23e7f1ec71123127f30a60de7758acc0935e123c /clang/lib/CodeGen/CodeGenFunction.cpp
parentdd06b8e679fd28f51cd065401062041a40b87f9c (diff)
downloadllvm-421085fd740d937559db068c0a1b354b033aca63.zip
llvm-421085fd740d937559db068c0a1b354b033aca63.tar.gz
llvm-421085fd740d937559db068c0a1b354b033aca63.tar.bz2
[Offload] Change unregister library to use `atexit` instead of destructor (#86830)
Summary: The 'new driver' sets up the lifetime of a registered liftime using global constructors and destructors. Currently, this is put at priority 1 which isn't strictly conformant as it will conflict with system utilities. We now use 101 as this is the loweest suggested for non-system constructors and will still run before user constructors. Secondly, there were issues with the CUDA runtime when destructed with a global destructor. Because the global ones are in any order and potentially run before other things we were hitting an edge case where the OpenMP runtime was uninitialized *after* `_dl_fini` was called. This would result in us erroring when we call into a destroyed `libcuda.so` instance. using `atexit` is what CUDA / HIP use and it prevents this from happening. Most everything uses `atexit` except system utilities and because of the constructor priority it will be unregistered *after* everything else but not after `_fl_fini`.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions