-
Notifications
You must be signed in to change notification settings - Fork 13.9k
std: move check for destroyed TLS variable #148037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
This comment has been minimized.
This comment has been minimized.
std: move check for destroyed TLS variable
The job Click to see the possible cause of the failure (guessed by this bot)
|
Queued db38fd3 with parent 11d2046, future comparison URL. |
When accessing a TLS variable, the comparison that checks whether the variable is initialised can be inlined to the call site. The comparison that checks whether the variable has been destroyed is however performed in the
#[cold]
accessor function. Since all call-sites need to check whether the returned pointer is null, this split prevents these two checks from being merged into one. Thus moving the liveliness check into the inlineable accessor may yield more optimal codegen. This is especially true in the case where the variable does not need destruction and thus no null pointer will ever be returned, as the null-pointer check can now be optimised out.