diff options
author | David Chase <drchase@google.com> | 2018-07-03 11:34:38 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2018-07-12 18:45:31 +0000 |
commit | 0029cd479e344e0fa6930331cf86e6f985508163 (patch) | |
tree | 79e951dc80efaad1863fe4bfc08ca06e727804b7 /src/cmd/compile/internal/ssa/deadstore.go | |
parent | bb364d49a9db585534aac965d1068bee0bda3054 (diff) | |
download | go-0029cd479e344e0fa6930331cf86e6f985508163.tar.gz go-0029cd479e344e0fa6930331cf86e6f985508163.zip |
cmd/compile: add LocalAddr that takes SP,mem operands
Lack of a well-defined order between VarDef and related
address operations sometimes causes problems with store order
and write barrier transformations; glitches in the order are
made irreparable (by later optimizations) if the two parts of
the glitch straddle a split in the original block caused by
insertion of a write barrier diamond.
Fix this by creating a LocalAddr for addresses of locals
(what VarDef matters for) that takes a memory input to
help make the order explicit. Addr is modified to only
be legal for SB operand, so there is no overlap between
Addr and LocalAddr uses (there may be some downstream
cleanup from this).
Changes to generic.rules and rewrite.go ensure that codegen
tests continue to pass; CSE of LocalAddr is impaired, not
quite sure of the cost.
Fixes #26105.
Change-Id: Id4192b4440aa4e9d7ba54a465c456df9b530b515
Reviewed-on: https://go-review.googlesource.com/122483
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/deadstore.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/deadstore.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/deadstore.go b/src/cmd/compile/internal/ssa/deadstore.go index e92521a79c..6359588129 100644 --- a/src/cmd/compile/internal/ssa/deadstore.go +++ b/src/cmd/compile/internal/ssa/deadstore.go @@ -146,7 +146,7 @@ func elimDeadAutosGeneric(f *Func) { visit := func(v *Value) (changed bool) { args := v.Args switch v.Op { - case OpAddr: + case OpAddr, OpLocalAddr: // Propagate the address if it points to an auto. n, ok := v.Aux.(GCNode) if !ok || n.StorageClass() != ClassAuto { |