mirror of
https://github.com/golang/go
synced 2024-10-05 18:21:21 -06:00
[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>
This commit is contained in:
parent
46ffb026b4
commit
fda72e0375
@ -30,7 +30,7 @@ func dse(f *Func) {
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user