]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: consider full number of struct components to deciding on inlining ==
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 2 May 2017 18:17:57 +0000 (11:17 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 30 Mar 2018 19:04:43 +0000 (19:04 +0000)
Change-Id: I6bfbbce2ec5dfc7f9f99dbd82e51c2b0edacc87a
Reviewed-on: https://go-review.googlesource.com/59334
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/walk.go

index 494b7c5970bb9a283827762c92848806e4f3c3e4..7798a4f36409681cda0acd638314861c8b2d8a98 100644 (file)
@@ -3298,7 +3298,7 @@ func walkcompare(n *Node, init *Nodes) *Node {
                // We can compare several elements at once with 2/4/8 byte integer compares
                inline = t.NumElem() <= 1 || (issimple[t.Elem().Etype] && (t.NumElem() <= 4 || t.Elem().Width*t.NumElem() <= maxcmpsize))
        case TSTRUCT:
-               inline = t.NumFields() <= 4
+               inline = t.NumComponents() <= 4
        }
 
        cmpl := n.Left