]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.regabi] cmd/compile: clean up ONEW node
authorRuss Cox <rsc@golang.org>
Mon, 30 Nov 2020 19:16:39 +0000 (14:16 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 30 Nov 2020 23:48:29 +0000 (23:48 +0000)
The list is no longer needed and can be deleted.
Doing so reduces the inlining cost of any function containing
an explicit call to new by 1 point, so this change is not
toolstash -cmp safe.

Change-Id: Id29e115d68e466a353708ab4b8c1021e9c85a628
Reviewed-on: https://go-review.googlesource.com/c/go/+/274132
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/typecheck.go

index f021ea48b14af7fe64e18f1e75734204c9ec6e16..874594d764dcebf4411295324f2fbf4e1dd1ad9c 100644 (file)
@@ -1315,11 +1315,6 @@ func typecheck1(n ir.Node, top int) (res ir.Node) {
                                old := n
                                n = ir.NodAt(n.Pos(), l.SubOp(), arg, nil)
                                n = addinit(n, old.Init().Slice()) // typecheckargs can add to old.Init
-                               if l.SubOp() == ir.ONEW {
-                                       // Bug-compatibility with earlier version.
-                                       // This extra node is unnecessary but raises the inlining cost by 1.
-                                       n.SetList(old.List())
-                               }
 
                        case ir.OCOMPLEX, ir.OCOPY:
                                typecheckargs(n)