Commit fda72e03 authored by Keith Randall's avatar Keith Randall

[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/14536Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 46ffb026
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment