Skip to content

Commit d05d6fa

Browse files
committed
[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 <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Trust: Baokun Lee <[email protected]>
1 parent 48badc5 commit d05d6fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cmd/compile/internal/ssa/deadstore.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func elimUnreadAutos(f *Func) {
299299
// Loop over all ops that affect autos taking note of which
300300
// autos we need and also stores that we might be able to
301301
// eliminate.
302-
seen := make(map[*ir.Name]bool)
302+
var seen ir.NameSet
303303
var stores []*Value
304304
for _, b := range f.Blocks {
305305
for _, v := range b.Values {
@@ -317,7 +317,7 @@ func elimUnreadAutos(f *Func) {
317317
// If we haven't seen the auto yet
318318
// then this might be a store we can
319319
// eliminate.
320-
if !seen[n] {
320+
if !seen.Has(n) {
321321
stores = append(stores, v)
322322
}
323323
default:
@@ -327,7 +327,7 @@ func elimUnreadAutos(f *Func) {
327327
// because dead loads haven't been
328328
// eliminated yet.
329329
if v.Uses > 0 {
330-
seen[n] = true
330+
seen.Add(n)
331331
}
332332
}
333333
}
@@ -336,7 +336,7 @@ func elimUnreadAutos(f *Func) {
336336
// Eliminate stores to unread autos.
337337
for _, store := range stores {
338338
n, _ := store.Aux.(*ir.Name)
339-
if seen[n] {
339+
if seen.Has(n) {
340340
continue
341341
}
342342

0 commit comments

Comments
 (0)