]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: don't penalize ODOT and friends when inlining
authorIan Lance Taylor <iant@golang.org>
Sat, 19 Mar 2016 01:12:14 +0000 (18:12 -0700)
committerIan Lance Taylor <iant@golang.org>
Sun, 20 Mar 2016 17:25:02 +0000 (17:25 +0000)
Historically ODOT and friends have been considered to cost an extra
budget point when deciding whether they should be inlined, because they
had an ONAME node that represented the name to the right of the dot.
This doesn't really make sense, as in general that symbol does not add
any extra instructions; it just affects the offset of the load or store
instruction.  And the ONAME node is gone now.  So, remove the extra
cost.

This does not pass toolstash -cmp, as it changes inlining decisions.
For example, mspan.init in runtime/mheap.go is now considered to be an
inlining candidate.

Change-Id: I5ad27f08c66fd5daa4c8472dd0795df989183f5e
Reviewed-on: https://go-review.googlesource.com/20891
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/inl.go

index cc311c4445baa21d8da4be6a206ac8393ce864ea..77cdc195f0a763716d150c07fa5b6bd6ebdfb18d 100644 (file)
@@ -220,13 +220,6 @@ func ishairy(n *Node, budget *int) bool {
                ODCLTYPE, // can't print yet
                ORETJMP:
                return true
-
-       case ODOT, ODOTPTR, ODOTMETH, ODOTINTER:
-               // These used to store the symbol name as an ONAME in
-               // the Right field, meaning that it cost one budget
-               // unit.  Stay compatible for now.
-               // TODO(iant): Remove this.
-               (*budget)--
        }
 
        (*budget)--