Should generate llvm.threadlocal.address for TLS accesses #136044
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
A-thread-locals
Area: Thread local storage (TLS)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
See https://llvm.org/docs/LangRef.html#llvm-threadlocal-address-intrinsic. Instead of directly accessing the global, the result of
@llvm.threadlocal.address(ptr @g)
should be accessed.This is required for correctness when using LLVM coroutines (not relevant for Rust), but it should also improve codegen in some cases because it will allow CSE/LICM of the TLS address calculation.
The text was updated successfully, but these errors were encountered: