mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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:
parent
b2e8630f2f
commit
812b34efae
1 changed files with 4 additions and 0 deletions
|
|
@ -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--
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue