]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: tweak inlining to favor PPARAM call sites
authorDavid Chase <drchase@google.com>
Wed, 28 Aug 2024 14:34:54 +0000 (10:34 -0400)
committerDavid Chase <drchase@google.com>
Tue, 22 Oct 2024 17:24:49 +0000 (17:24 +0000)
commita464ffda3e44c87de946cc29f719794a30e9b3f4
treeedc66f977b4e60a3274f1b242446a7e96bb45d58
parent74163c895a7c5d7ebafeaed1f4a0891d218e2704
cmd/compile: tweak inlining to favor PPARAM call sites

If a function f being considered for inlining calls
one of its parameters, reduce the normal cost of that
call (57) to 17 to increase the chance that f will
be inlined and (with luck) that parameter will be
revealed as a constant function (which unblocks
escape analysis) or perhaps even be inlined.

The least-change value for that was still effective for
iter_test benchmarks was 32; however tests showed no
particular harm even when reduced as low as 7, and there
have been reports of other performance problems with
rangefunc overheads and so I picked a middling number
in hopes of warding off such reports.

Updates #69015

Change-Id: I2a525c1beffb9f88daa14caa8a622864b023675c
Reviewed-on: https://go-review.googlesource.com/c/go/+/609095
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/inline/inlheur/testdata/props/acrosscall.go
src/cmd/compile/internal/inline/inlheur/testdata/props/calls.go