Open
Description
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.