-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: reordering regular loads over atomic add #20335
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
Labels
Milestone
Comments
Minimal repro:
The
There's more than one memory variable live before v11 (v1 and v14). |
CL https://golang.org/cl/43294 mentions this issue. |
CL https://golang.org/cl/43311 mentions this issue. |
Reopen for 1.8.2. |
CL https://golang.org/cl/43411 mentions this issue. |
CL https://golang.org/cl/43495 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
May 15, 2017
Enhance the one-live-memory-at-a-time check to run during many more phases of the SSA backend. Also make it work in an interblock fashion. Change types.IsMemory to return true for tuples containing a memory type. Fix trim pass to build the merged phi correctly. Doesn't affect code but allows the check to pass after trim runs. Switch the AddTuple* ops to take the memory-containing tuple argument second. Update #20335 Change-Id: I5b03ef3606b75a9e4f765276bb8b183cdc172b43 Reviewed-on: https://go-review.googlesource.com/43495 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
gopherbot
pushed a commit
that referenced
this issue
May 23, 2017
Cherry-pick of CL 43294. Tuple ops are weird. They are essentially a pair of ops, one which consumes a mem and one which generates a mem (the Select1). The schedule pass didn't handle these quite right. Fix the scheduler to include both parts of the paired op in the store chain. That makes sure that loads are correctly ordered with respect to the first of the pair. Add a check for the ssacheck builder, that there is only one live store at a time. I thought we already had such a check, but apparently not... Fixes #20335 Change-Id: I59eb3446a329100af38d22820b1ca2190ca46a78 Reviewed-on: https://go-review.googlesource.com/43411 Run-TryBot: Austin Clements <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Tested on both
go version go1.8.1 linux/amd64
andgo version devel +8c49c06b48 Mon May 8 15:16:21 2017 +0000 linux/amd64
.What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
runtime.gchelper
ends with the following few lines:What did you expect to see?
I expected the
atomic.Xadd
to act as a memory fence and force the regular load ofwork.nproc
to happen before the atomic.What did you see instead?
The compiler reorders the regular load to occur after the
atomic.Xadd
. I believe this is leading to #19305./cc @dr2chase @cherrymui
The text was updated successfully, but these errors were encountered: