]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: simplify PGO hot caller/callee computation
authorCherry Mui <cherryyz@google.com>
Tue, 15 Nov 2022 18:32:32 +0000 (13:32 -0500)
committerCherry Mui <cherryyz@google.com>
Thu, 17 Nov 2022 20:52:15 +0000 (20:52 +0000)
commit3f1bcc58b32dbbf7f27fbe0984b95036ddb249b9
treea9100efec2720fcfb1946dadb5b7b338524bafc8
parent81c9b1d65f3e416e134a30484c4bd6563aa825b5
cmd/compile: simplify PGO hot caller/callee computation

Currently, we use CDF to compute a weight threshold and then use
the weight threshold to determine whether a call site is hot. As
when we compute the CDF we already have a list of hot call sites
that make up the given percentage of the CDF, just use that list.

Also, when computing the CDF threshold, include the very last node
that makes it to go over the threshold. (I.e. if the CDF threshold
is 50% and one hot node takes 60% of weight, we should include that
node instead of excluding it. In practice it rarely matters,
probably only for testing and micro-benchmarks.)

Change-Id: I535ae9cd6b679609e247c3d0d9ee572c1a1187cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/450737
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/inline/inl.go