aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/cse.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2016-05-03 13:58:28 -0700
committerKeith Randall <khr@golang.org>2016-05-03 22:45:53 +0000
commitb64c7fc6832902acb8eebc67c887d2ef9114f644 (patch)
tree7ff2d0fae520ff6af92ff3ad2177a96542f8270d /src/cmd/compile/internal/ssa/cse.go
parent01182425f847e4c98a53c60d0994175e21fd06dd (diff)
downloadgo-b64c7fc6832902acb8eebc67c887d2ef9114f644.tar.gz
go-b64c7fc6832902acb8eebc67c887d2ef9114f644.zip
cmd/compile: never CSE two memories
It never makes sense to CSE two ops that generate memory. We might as well start those ops off in their own partition. Fixes #15520 Change-Id: I0091ed51640f2c10cd0117f290b034dde7a86721 Reviewed-on: https://go-review.googlesource.com/22741 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/cse.go')
-rw-r--r--src/cmd/compile/internal/ssa/cse.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/ssa/cse.go b/src/cmd/compile/internal/ssa/cse.go
index d501f75e02..8cc0db1d17 100644
--- a/src/cmd/compile/internal/ssa/cse.go
+++ b/src/cmd/compile/internal/ssa/cse.go
@@ -257,13 +257,10 @@ func cmpVal(v, w *Value, auxIDs auxmap, depth int) Cmp {
if v.Op == OpPhi && v.Block != w.Block {
return lt2Cmp(v.Block.ID < w.Block.ID)
}
-
- switch v.Op {
- case OpStaticCall, OpAMD64CALLstatic, OpARMCALLstatic:
- sym := v.Aux.(GCSym)
- if sym.IsRuntimeCall("newobject") {
- return lt2Cmp(v.ID < w.ID)
- }
+ if v.Type.IsMemory() {
+ // We will never be able to CSE two values
+ // that generate memory.
+ return lt2Cmp(v.ID < w.ID)
}
if tc := v.Type.Compare(w.Type); tc != CMPeq {