diff options
| author | Cherry Mui <cherryyz@google.com> | 2022-11-10 11:33:00 -0500 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2022-11-10 23:11:59 +0000 |
| commit | 1b03568ae18715ad081cc57197b61388c8e6caa4 (patch) | |
| tree | bbde065d0783ae8ecb54445ed882faab4a18655d /src/cmd/compile/internal/inline | |
| parent | 5497300d9c9327005fa9ab14c6897d6c883139c5 (diff) | |
| download | go-1b03568ae18715ad081cc57197b61388c8e6caa4.tar.xz | |
cmd/compile: adjust PGO inlining default parameters
Adjust PGO inlining default parameters to 99% CDF threshold and
2000 budget. Benchmark results (mostly from Sweet) show that this
set of parameters performs reasonably well, with a few percent
speedup at the cost of a few percent binary size increase.
Also rename the debug flags to start with "pgo", to make it clear
that they are related to PGO.
Change-Id: I0749249b1298d1dc55a28993c37b3185f9d7639d
Reviewed-on: https://go-review.googlesource.com/c/go/+/449477
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/inline')
| -rw-r--r-- | src/cmd/compile/internal/inline/inl.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go index aebe32869a..028b6c0e83 100644 --- a/src/cmd/compile/internal/inline/inl.go +++ b/src/cmd/compile/internal/inline/inl.go @@ -76,15 +76,15 @@ var ( // that is, for a threshold of X the hottest callsites that // make up the top X% of total edge weight will be // considered hot for inlining candidates. - inlineCDFHotCallSiteThresholdPercent = float64(95) + inlineCDFHotCallSiteThresholdPercent = float64(99) // Budget increased due to hotness. - inlineHotMaxBudget int32 = 160 + inlineHotMaxBudget int32 = 2000 ) // pgoInlinePrologue records the hot callsites from ir-graph. func pgoInlinePrologue(p *pgo.Profile, decls []ir.Node) { - if s, err := strconv.ParseFloat(base.Debug.InlineHotCallSiteCDFThreshold, 64); err == nil { + if s, err := strconv.ParseFloat(base.Debug.PGOInlineCDFThreshold, 64); err == nil { inlineCDFHotCallSiteThresholdPercent = s } var hotCallsites []pgo.NodeMapKey @@ -93,8 +93,8 @@ func pgoInlinePrologue(p *pgo.Profile, decls []ir.Node) { fmt.Printf("hot-callsite-thres-from-CDF=%v\n", inlineHotCallSiteThresholdPercent) } - if base.Debug.InlineHotBudget != 0 { - inlineHotMaxBudget = int32(base.Debug.InlineHotBudget) + if x := base.Debug.PGOInlineBudget; x != 0 { + inlineHotMaxBudget = int32(x) } // mark inlineable callees from hot edges |
