aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/deadstore.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2020-12-06 18:28:49 -0800
committerMatthew Dempsky <mdempsky@google.com>2020-12-08 01:47:13 +0000
commitdbf2fc8cff5f7d6a5fcbeea0d4b0349cc7d158e2 (patch)
tree944cf97e977d34ee266d8a4710812c0d1b365226 /src/cmd/compile/internal/ssa/deadstore.go
parentbb31c75343de2114f541cd66870ace3f33047550 (diff)
downloadgo-dbf2fc8cff5f7d6a5fcbeea0d4b0349cc7d158e2.tar.gz
go-dbf2fc8cff5f7d6a5fcbeea0d4b0349cc7d158e2.zip
[dev.regabi] cmd/compile: replace many uses of ir.Node with *ir.Name
This commit adds exactly two "n := n.(*ir.Name)" statements, that are each immediately preceded by a "case ir.ONAME:" clause in an n.Op() switch. The rest of the changes are simply replacing "ir.Node" to "*ir.Name" and removing now unnecessary "n.(*ir.Name)" type assertions, exposing the latent typing details. Passes buildall w/ toolstash -cmp. Updates #42982. Change-Id: I8ea3bbb7ddf0c7192245cafa49a19c0e7a556a39 Reviewed-on: https://go-review.googlesource.com/c/go/+/275791 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/deadstore.go')
-rw-r--r--src/cmd/compile/internal/ssa/deadstore.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/deadstore.go b/src/cmd/compile/internal/ssa/deadstore.go
index d0446a0311..a68c82ba97 100644
--- a/src/cmd/compile/internal/ssa/deadstore.go
+++ b/src/cmd/compile/internal/ssa/deadstore.go
@@ -137,9 +137,9 @@ func dse(f *Func) {
// reaches stores then we delete all the stores. The other operations will then
// be eliminated by the dead code elimination pass.
func elimDeadAutosGeneric(f *Func) {
- addr := make(map[*Value]ir.Node) // values that the address of the auto reaches
- elim := make(map[*Value]ir.Node) // values that could be eliminated if the auto is
- used := make(map[ir.Node]bool) // used autos that must be kept
+ addr := make(map[*Value]*ir.Name) // values that the address of the auto reaches
+ elim := make(map[*Value]*ir.Name) // values that could be eliminated if the auto is
+ used := make(map[*ir.Name]bool) // used autos that must be kept
// visit the value and report whether any of the maps are updated
visit := func(v *Value) (changed bool) {
@@ -222,7 +222,7 @@ func elimDeadAutosGeneric(f *Func) {
}
// Propagate any auto addresses through v.
- var node ir.Node
+ var node *ir.Name
for _, a := range args {
if n, ok := addr[a]; ok && !used[n] {
if node == nil {
@@ -299,7 +299,7 @@ func elimUnreadAutos(f *Func) {
// Loop over all ops that affect autos taking note of which
// autos we need and also stores that we might be able to
// eliminate.
- seen := make(map[ir.Node]bool)
+ seen := make(map[*ir.Name]bool)
var stores []*Value
for _, b := range f.Blocks {
for _, v := range b.Values {