]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/inline/inleur: use "largest possible score" to revise inlinability
authorThan McIntosh <thanm@google.com>
Fri, 15 Sep 2023 19:48:49 +0000 (15:48 -0400)
committerThan McIntosh <thanm@google.com>
Wed, 8 Nov 2023 15:03:14 +0000 (15:03 +0000)
commit04d64a3b36f872e97d965197337d001d5361d71c
tree130347e76e02406e14768cc9fe0dbf02874d5f1f
parent74350dd603a3480e1402a6ec98608ccb11246fb1
cmd/compile/inline/inleur: use "largest possible score" to revise inlinability

The current GOEXPERIMENT=newinliner strategy us to run "CanInline" for
a given function F with an expanded/relaxed budget of 160 (instead of
the default 80), and then only inline a call to F if the adjustments
we made to F's original score are below 80.

This way of doing things winds up writing out many more functions to
export data that have size between 80 and 160, on the theory that they
might be inlinable somewhere given the right context, which is
expensive from a compile time perspective.

This patch changes things to add a pass that revises the inlinability
of a function after its properties are computed by looking at its
properties and estimating the largest possible negative score
adjustment that could happen given the various return and param props.
If the computed score for the function minus the max adjust is not
less than 80, then we demote it from inlinable to non-inlinable to
save compile time.

Change-Id: Iedaac520d47f632be4fff3bd15d30112b46ec573
Reviewed-on: https://go-review.googlesource.com/c/go/+/529118
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/inline/inlheur/analyze.go
src/cmd/compile/internal/inline/inlheur/scoring.go