[llvm] [AMDGPU] IGLP: Fix static variables (PR #137549)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 16 09:06:11 PDT 2026
shiltian wrote:
> This is not true, and it is something we need to worry about. You can have different LLVMContexts in different threads for parallel compilers.
I'd argue the `LLVMContext` per thread is the maximum that we can promise at LLVM level but IIRC even with `LLVMContext` per thread, it is not really thread safe. I definitely ran into some weird issue when I was working on JIT compilation for OpenMP back a few years ago, and I did have one context per thread.
However, the real problem that this PR is trying to resolve is not really related to multi-threading. The static counters should definitely be reset properly.
https://github.com/llvm/llvm-project/pull/137549
More information about the llvm-commits
mailing list