]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/pgo: check repeated edge only when node is seen
authorCherry Mui <cherryyz@google.com>
Fri, 4 Nov 2022 01:22:44 +0000 (21:22 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 4 Nov 2022 21:19:24 +0000 (21:19 +0000)
commitf187c6b08eac9dddd161bb2e7537def3bbf8ec9a
treec401c1d3cfa190296c9a5569ccdfa4da5b744ceb
parent9dcc873413aa390bd9392d1ed6ae4198593e4c5d
cmd/compile/internal/pgo: check repeated edge only when node is seen

When adding weights for a call stack, for recursive calls, to
avoid double counting we check if we already saw the node and the
edge. We check the node first. An edge can be repeated if the node
is repeated. Most stacks are not recursive, so check repeated edge
only conditionally.

Change-Id: I4b8f039289dcd3383ca89593d6d16d903b94c3dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/447804
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/cmd/compile/internal/pgo/graph.go