about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/builder.rs
diff options
context:
space:
mode:
authorChris Denton <christophersdenton@gmail.com>2024-03-16 18:27:34 +0000
committerGitHub <noreply@github.com>2024-03-16 18:27:34 +0000
commita9f8f8b070db99a476393c1a9444a2860d67ca83 (patch)
treec75ae3d04dda3934a4dfa054b1a2d946c777a0c9 /compiler/rustc_codegen_llvm/src/builder.rs
parent42e03fc158e21818c23f0b155b3d1336507ae3db (diff)
parentb0b249399a97e7f3ac97996f26993bf67fc9bfba (diff)
downloadrust-a9f8f8b070db99a476393c1a9444a2860d67ca83.tar.gz
rust-a9f8f8b070db99a476393c1a9444a2860d67ca83.zip
Rollup merge of #122583 - Zoxc:tls-non-mut, r=joboet
Use `UnsafeCell` for fast constant thread locals

This uses `UnsafeCell` instead of `static mut` for fast constant thread locals. This changes the type of the TLS shims to return `&UnsafeCell<T>` instead of `*mut T` which means they are always non-null so LLVM can optimize away the check for `Some` in `LocalKey::with` if `T` has no destructor.

LLVM is currently unable to do this optimization as we lose the fact that `__getit` always returns `Some` as it gets optimized to just returning the value of the TLS shim.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
0 files changed, 0 insertions, 0 deletions