-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/compile: dynamic checks for atomics should be removed for ARM64 targets that support LSE #66131
Comments
Related to #60905. |
@aktau @mauri870 @cherrymui @mengzhuo @zhangfannie I plan to work on fixing this; please assign this ticket on me. |
Change https://go.dev/cl/569536 mentions this issue: |
…omics for ARM64 targets that support LSE Remove dynamic checks for atomic instructions for ARM64 targets that support LSE extension. For #66131 Change-Id: I0ec1b183a3f4ea4c8a537430646e6bc4b4f64271 Reviewed-on: https://go-review.googlesource.com/c/go/+/569536 Reviewed-by: Mauri de Souza Meneguzzo <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Fannie Zhang <[email protected]> Reviewed-by: Shu-Chun Weng <[email protected]>
Recently, I tested the
The Go compiler do not intrinsify the
Any ideas? Thank you. |
Thanks for bringing this up. The And/Or atomic primitives were added very recently, there is not even the public sync/atomic apis exposed yet. I don't think we have any compiler optimized implementation yet, so that might relate with the regression. |
@mauri870 Yes, the compiler does not intrinsify them. They are all implemented in assmbly codes. Take the implmentation of
If |
Clean the test environment by running But I'm not sure if this is the root cause of the performance regression. |
Go version
upstream
Output of
go env
in your module/workspace:What did you do?
test.go:
Build:
Get disassembly:
What did you see happen?
Atomic add includes checks for presence of atomic instructions and a loop for ARM64 architectures that don't support them:
What did you expect to see?
With
GOARCH=arm64 GOARM64=v8.2
we can eliminate runtime checks and thus, improve performance.The text was updated successfully, but these errors were encountered: