commit | fda72e03751ab876ced9351611e42ad019090ec8 | [log] [tgz] |
---|---|---|
author | Keith Randall <khr@golang.org> | Sat Sep 12 14:45:58 2015 -0700 |
committer | Keith Randall <khr@golang.org> | Sat Sep 12 22:10:58 2015 +0000 |
tree | 9a83594bb43d5936d41cc8358d2c96f2bb249f52 | |
parent | 46ffb026b4ffc5a872a74a4ec3892b8ddad8bd8e [diff] |
[dev.ssa] cmd/compile/internal/ssa: don't treat vardef/varkill as reads This makes deadstore elimination work reasonably again. Change-Id: I3a8caced71f12dfb6c1d0c68b7a7d8d7a736ea23 Reviewed-on: https://go-review.googlesource.com/14536 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/src/cmd/compile/internal/ssa/deadstore.go b/src/cmd/compile/internal/ssa/deadstore.go index 982bd7f..89f7504 100644 --- a/src/cmd/compile/internal/ssa/deadstore.go +++ b/src/cmd/compile/internal/ssa/deadstore.go
@@ -30,7 +30,7 @@ for _, a := range v.Args { if a.Block == b && a.Type.IsMemory() { storeUse.add(a.ID) - if v.Op != OpStore && v.Op != OpZero { + if v.Op != OpStore && v.Op != OpZero && v.Op != OpVarDef && v.Op != OpVarKill { // CALL, DUFFCOPY, etc. are both // reads and writes. loadUse.add(a.ID)