mirror of
https://github.com/golang/go.git
synced 2025-11-10 13:41:05 +00:00
[dev.regabi] cmd/compile: replace ir.Name map with ir.NameSet for SSA 2
Same as CL 284897, the last one. Passes toolstash -cmp. Updates #43819 Change-Id: I0bd8958b3717fb58a5a6576f1819a85f33b76e2d Reviewed-on: https://go-review.googlesource.com/c/go/+/285913 Run-TryBot: Baokun Lee <bk@golangcn.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Trust: Baokun Lee <bk@golangcn.org>
This commit is contained in:
parent
48badc5fa8
commit
d05d6fab32
1 changed files with 4 additions and 4 deletions
|
|
@ -299,7 +299,7 @@ func elimUnreadAutos(f *Func) {
|
||||||
// Loop over all ops that affect autos taking note of which
|
// Loop over all ops that affect autos taking note of which
|
||||||
// autos we need and also stores that we might be able to
|
// autos we need and also stores that we might be able to
|
||||||
// eliminate.
|
// eliminate.
|
||||||
seen := make(map[*ir.Name]bool)
|
var seen ir.NameSet
|
||||||
var stores []*Value
|
var stores []*Value
|
||||||
for _, b := range f.Blocks {
|
for _, b := range f.Blocks {
|
||||||
for _, v := range b.Values {
|
for _, v := range b.Values {
|
||||||
|
|
@ -317,7 +317,7 @@ func elimUnreadAutos(f *Func) {
|
||||||
// If we haven't seen the auto yet
|
// If we haven't seen the auto yet
|
||||||
// then this might be a store we can
|
// then this might be a store we can
|
||||||
// eliminate.
|
// eliminate.
|
||||||
if !seen[n] {
|
if !seen.Has(n) {
|
||||||
stores = append(stores, v)
|
stores = append(stores, v)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
@ -327,7 +327,7 @@ func elimUnreadAutos(f *Func) {
|
||||||
// because dead loads haven't been
|
// because dead loads haven't been
|
||||||
// eliminated yet.
|
// eliminated yet.
|
||||||
if v.Uses > 0 {
|
if v.Uses > 0 {
|
||||||
seen[n] = true
|
seen.Add(n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -336,7 +336,7 @@ func elimUnreadAutos(f *Func) {
|
||||||
// Eliminate stores to unread autos.
|
// Eliminate stores to unread autos.
|
||||||
for _, store := range stores {
|
for _, store := range stores {
|
||||||
n, _ := store.Aux.(*ir.Name)
|
n, _ := store.Aux.(*ir.Name)
|
||||||
if seen[n] {
|
if seen.Has(n) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue