-
Notifications
You must be signed in to change notification settings - Fork 18k
Illegal instructions (SSE4) in go1.19+ -race builds (fails on some Intel Atom cores) #53743
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
Comments
Sounds like we need an |
This was done intentionally in https://reviews.llvm.org/D106948 I'm not sure if there's anything we can do here. We could conceivably remove that patch and rebuild, but I'm not sure what the implications would be. Presumably just performance? The other OSes don't bump up the requirement, so it presumably still works without it. The other option would be to require sse4 when running with -race. In that case, we should provide a better error message. |
Change https://go.dev/cl/416477 mentions this issue: |
Getting rid of the @thanm This hasn't reached the windows .syso yet, but it will once the changes you're working on land. We should coordinate the rollback so we don't introduce a sse41 dependency in the new windows .syso. |
It looks to me like the low-power Atom cores didn't support this until 2013 and in some cases 2016. Might it be possible to have slower fallback paths should they be required? These older cores are still quite prevalent in some places. |
I suspect a runtime switch will be too expensive. Besides the load-check-branch itself, inlining both version or adding a call will break register alloc. A proper runtime check in the tsan runtime would be good. The info should be somewhere in CPUID, right? |
Yes, we could condition on the
Yes. There's probably a whole set that are required by Do you know how much adding |
Running
without
So Running some randomly selected TensorFlow C++ tests with
without
For avg time this is -9.6%, -9.2%, -21.7%, -17.8%, -5.9% with |
I'm ok with a ~15% slowdown, to keep |
I'll put together an LLVM CL for this later in the week. |
Sent https://reviews.llvm.org/D129482 with change to Go build scripts. |
This is a partial revert of https://reviews.llvm.org/D106948, changing just the Go build rules to remove -msse4.2 and revert back to -msse3, so as to preserve support for older x86 machines. More details at golang/go#53743. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D129482
LLVM change is submitted. I will work on sending another CL that updates the linux, freebsd, and darwin syso images. |
Change https://go.dev/cl/416857 mentions this issue: |
OK, I am going to submit CL 416857, which should resolve this. Note that this updates darwin, freebsd, and linux. The current windows/amd64 syso is old enough that it shouldn't have the problem, and for openbsd/netbsd there are other things blocking the update. |
@thanm thanks! I confirm this is working. |
Add more opcodes that are only available in >v1 modes. This test will now correctly detect the regression in -race mode for #53743. Change-Id: Icfbb1384e4333d7b4ff167c9ebcb6f4c7aeb6134 Reviewed-on: https://go-review.googlesource.com/c/go/+/416477 Reviewed-by: Than McIntosh <[email protected]> Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
Rebuild selected amd64 syso images with updated LLVM build rules that avoid the use of SSE4, so as to ensure that the Go race detector continues to work on older x86 cpus. No changes to the syso files for openbsd/amd64 (upstream support has been removed in LLVM) or netbsd/amd64 (work still in progress there). Fixes golang#53743. Change-Id: I738ae4d1e0528c6e06dd4ddb78e7039a30a51779 Reviewed-on: https://go-review.googlesource.com/c/go/+/416857 Reviewed-by: Cherry Mui <[email protected]> Run-TryBot: Than McIntosh <[email protected]>
Add more opcodes that are only available in >v1 modes. This test will now correctly detect the regression in -race mode for golang#53743. Change-Id: Icfbb1384e4333d7b4ff167c9ebcb6f4c7aeb6134 Reviewed-on: https://go-review.googlesource.com/c/go/+/416477 Reviewed-by: Than McIntosh <[email protected]> Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
This is a partial revert of https://reviews.llvm.org/D106948, changing just the Go build rules to remove -msse4.2 and revert back to -msse3, so as to preserve support for older x86 machines. More details at golang/go#53743. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D129482
Change https://go.dev/cl/444396 mentions this issue: |
Makes -race mode faster, in the 15% speedup range. Update #53743 Change-Id: I735eb71902b41c924c9f885ded8f7a350a56b751 Reviewed-on: https://go-review.googlesource.com/c/go/+/444396 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
Makes -race mode faster, in the 15% speedup range. Update golang#53743 Change-Id: I735eb71902b41c924c9f885ded8f7a350a56b751 Reviewed-on: https://go-review.googlesource.com/c/go/+/444396 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
This is a partial revert of https://reviews.llvm.org/D106948, changing just the Go build rules to remove -msse4.2 and revert back to -msse3, so as to preserve support for older x86 machines. More details at golang/go#53743. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D129482
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
go build -race
generates SSE4 instruction(s) that are executed on non-SSE4 capable CPUs (old Intel Atom).(
pinsrq
specifically)go1.18 works as expected
What did you expect to see?
program should run
What did you see instead?
crash, no output, fails in early runtime:
using gdb:
...
The text was updated successfully, but these errors were encountered: