commit | c1ac63e9732a54ef8349fe0bdbb3fa47bd0847c2 | [log] [tgz] |
---|---|---|
author | Michael Pratt <mpratt@google.com> | Tue Mar 28 12:45:17 2023 -0400 |
committer | Michael Pratt <mpratt@google.com> | Mon Apr 10 21:06:54 2023 +0000 |
tree | 371dd9bf1bee7ae6849c7f0b555be79b2cf9e698 | |
parent | a5c79283f79b5f03296fc2037f32d935aaec806f [diff] |
cmd/compile: don't inline hot calls into big functions Standard inlining has a reduced maximum cost of callees (20 instead of 80) when inlining into a "big" function, to limit how much bigger we will make an already big function. When adding PGO hot call budget increases, we inadvertently bypassed this "big" function restriction, allowing hot calls of up to inlineHotMaxBudget, even into big functions. Add the restriction back, even for hot calls. If a function is already very large, we probably shouldn't inline even more. A very important note here is that function "big"-ness is computed prior to any inlining. One potential problem with PGO is that many hot calls inline into an initially-small function and ultimately make it very large. This CL does nothing to address that case, which would require recomputing size after inlining. This CL has no impact on sweet PGO benchmarks. I specifically dug into tile38, which contained 0 hot big functions. Other benchmarks are probably similar. Change-Id: I3b6304eaf7738a219359d4b8bb121d68babfea8b Reviewed-on: https://go-review.googlesource.com/c/go/+/482157 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Michael Pratt <mpratt@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.