diff options
| author | Chris Denton <christophersdenton@gmail.com> | 2024-03-16 18:27:34 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-16 18:27:34 +0000 |
| commit | a9f8f8b070db99a476393c1a9444a2860d67ca83 (patch) | |
| tree | c75ae3d04dda3934a4dfa054b1a2d946c777a0c9 /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | 42e03fc158e21818c23f0b155b3d1336507ae3db (diff) | |
| parent | b0b249399a97e7f3ac97996f26993bf67fc9bfba (diff) | |
| download | rust-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
