]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/inline: rework call scoring for non-inlinable funcs
authorThan McIntosh <thanm@google.com>
Fri, 10 Nov 2023 12:57:46 +0000 (07:57 -0500)
committerThan McIntosh <thanm@google.com>
Wed, 15 Nov 2023 14:26:26 +0000 (14:26 +0000)
commit15fa7a84b88165092d3a05fb0af11f11d967065d
tree6d12530b71fd2429c7b6b4e9f2b9d06bc4437052
parentd3d517375987dc1a9747bef0f3bb3c76aab6827e
cmd/compile/internal/inline: rework call scoring for non-inlinable funcs

This patch fixes some problems with call site scoring, adds some new
tests, and moves more of the scoring-related code (for example, the
function "ScoreCalls") into "scoring.go". This also fixes some
problems with scoring of calls in non-inlinable functions (when new
inliner is turned on, scoring has to happen for all functions run
through the inliner, not just for inlinable functions). For such
functions, we build a table of inlinable call sites immediately prior
to scoring; the storage for this table is preserved between functions
so as to reduce allocations.

Change-Id: Ie6f691a3ad04fb7a03ab39f882a60aadaf957f6c
Reviewed-on: https://go-review.googlesource.com/c/go/+/542217
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/analyze_func_callsites.go
src/cmd/compile/internal/inline/inlheur/callsite.go
src/cmd/compile/internal/inline/inlheur/dumpscores_test.go [new file with mode: 0644]
src/cmd/compile/internal/inline/inlheur/scoring.go
src/cmd/compile/internal/inline/inlheur/testdata/dumpscores.go [new file with mode: 0644]
src/cmd/compile/internal/inline/inlheur/testdata/props/calls.go