-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Enable outline-atomics by default on AArch64 FreeBSD
#149633
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: main
Are you sure you want to change the base?
Conversation
Build outline atomic symbols on all targets that have `outline-atomics` enabled, rather than only on Linux. Since this is no longer OS-specific, also rename the module.
Change the gating and link sections to enable this for any platforms that enable `outline-atomics`, rather than only Linux. Additionally, no longer run this if LSE is available, since in this case the outline versions will never be called.
Many aarch64 targets without LSE in the baseline enable the `outline-atomics` feature, which uses runtime detection of LSE for its faster atomic ops. This provides nontrivial performance improvements on most hardware from the past decade, at a small cost to anything pre-LSE. Clang does not currently have this enabled on FreeBSD (search for `IsAArch64OutlineAtomicsDefault` there) but there doesn't seem to be any specific reason not. Thus, enable it here.
fbeeee2 to
baebc7a
Compare
|
This will make FreeBSD act the same as most other targets after #144938, which also has some more details (as does the Zulip discussion). Cc target maintainers @asomers @MikaelUrankar, I split this off in case you would like to verify that this works since Clang doesn't have this enabled. Basically that means running some atomic ops with a debugger and making sure it uses the LSE fast path (details). Might be worth pinging some FreeBSD arm maintainers even if they don't work on Rust, in case they want to verify this or consider doing the same in Clang? @bors2 try |
|
These commits modify compiler targets. |
|
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
Enable `outline-atomics` by default on AArch64 FreeBSD try-job: dist-x86_64-freebsd
Many aarch64 targets without LSE in the baseline enable the
outline-atomicsfeature, which uses runtime detection of LSE for itsfaster atomic ops. This provides nontrivial performance improvements on
most hardware from the past decade, at a small cost to anything pre-LSE.
Clang does not currently have this enabled on FreeBSD (search for
IsAArch64OutlineAtomicsDefaultthere) but there doesn't seem to be anyspecific reason not. Thus, enable it here.
Based on #144938 which needs to land first (this PR is only meant to cover the final commit).
try-job: dist-x86_64-freebsd