aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/schedule.go
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2016-09-01 07:22:23 -0400
committerCherry Zhang <cherryyz@google.com>2016-09-01 14:25:46 +0000
commit1c53a1b1975adf69c594fbbd5b1ca13d783f9817 (patch)
tree0d792c9749b314219d7841c5b7b7e657be51a3e0 /src/cmd/compile/internal/ssa/schedule.go
parentf8555ea6fdbbfc32e26f351ac16138fad31a2d62 (diff)
downloadgo-1c53a1b1975adf69c594fbbd5b1ca13d783f9817.tar.gz
go-1c53a1b1975adf69c594fbbd5b1ca13d783f9817.zip
cmd/compile: fix scheduling of memory-producing tuple ops
Intrinsified atomic op produces <value,memory>. Make sure this memory is considered in the store chain calculation. Fixes #16948. Change-Id: I029f164b123a7e830214297f8373f06ea0bf1e26 Reviewed-on: https://go-review.googlesource.com/28350 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/schedule.go')
-rw-r--r--src/cmd/compile/internal/ssa/schedule.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go
index bf3fb27f90..ffc816b00f 100644
--- a/src/cmd/compile/internal/ssa/schedule.go
+++ b/src/cmd/compile/internal/ssa/schedule.go
@@ -128,9 +128,13 @@ func schedule(f *Func) {
// the calculated store chain is good only for this block.
for _, v := range b.Values {
if v.Op != OpPhi && v.Type.IsMemory() {
+ mem := v
+ if v.Op == OpSelect1 {
+ v = v.Args[0]
+ }
for _, w := range v.Args {
if w.Type.IsMemory() {
- nextMem[w.ID] = v
+ nextMem[w.ID] = mem
}
}
}