aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2023-03-28 12:45:17 -0400
committerMichael Pratt <mpratt@google.com>2023-04-10 21:06:54 +0000
commitc1ac63e9732a54ef8349fe0bdbb3fa47bd0847c2 (patch)
tree371dd9bf1bee7ae6849c7f0b555be79b2cf9e698 /misc
parenta5c79283f79b5f03296fc2037f32d935aaec806f (diff)
downloadgo-c1ac63e9732a54ef8349fe0bdbb3fa47bd0847c2.tar.gz
go-c1ac63e9732a54ef8349fe0bdbb3fa47bd0847c2.zip
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>
Diffstat (limited to 'misc')
0 files changed, 0 insertions, 0 deletions