Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/compile: use edge weights to decide inlineability in PGO
Currently, with PGO, the inliner uses node weights to decide if a function is inlineable (with a larger budget). But the actual inlining is determined by the weight of the call edge. There is a discrepancy that, if a callee node is hot but the call edge is not, it would not inlined, and marking the callee inlineable would of no use. Instead of using two kinds of weights, we just use the edge weights to decide inlineability. If a function is the callee of a hot call edge, its inlineability is determined with a larger threshold. For a function that exceeds the regular inlining budget, it is still inlined only when the call edge is hot, as it would exceed the regular inlining cost for non-hot call sites, even if it is marked inlineable. For #55022. Change-Id: I93fa9919fc6bcbb394e6cfe54ec96a96eede08f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/447015 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information
Showing
3 changed files
with
8 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters