1
0
mirror of https://github.com/golang/go synced 2024-11-19 21:54:40 -07:00

cmd/compile: ignore non-code nodes when inlining

Avoid counting nodes that don't generate code (eg, constants) against the
inlining budget.

Fixes #21749

Change-Id: I10fca073e64be7d304709ef33e125eb8c78d5e4d
Reviewed-on: https://go-review.googlesource.com/61250
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Mark Pulford 2017-09-03 23:53:38 +10:00 committed by Matthew Dempsky
parent b2e8630f2f
commit 812b34efae

View File

@ -279,6 +279,10 @@ func (v *hairyVisitor) visit(n *Node) bool {
ORETJMP:
v.reason = "unhandled op " + n.Op.String()
return true
case ODCLCONST, OEMPTY, OFALL, OLABEL:
// These nodes don't produce code; omit from inlining budget.
return false
}
v.budget--