]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/pgo: readability refactor
authorMichael Pratt <mpratt@google.com>
Tue, 19 Sep 2023 21:04:06 +0000 (17:04 -0400)
committerMichael Pratt <mpratt@google.com>
Fri, 13 Oct 2023 13:56:39 +0000 (13:56 +0000)
commit14c347f5ce924b5a0f05ec5737984cfeb294d9ac
treeb2d3d74bd8c200ecdfdfff78c03a7b9ab22a16ba
parentbfb8924653526d4c154c678f0d0bc491f60f7fce
cmd/compile/internal/pgo: readability refactor

Construction of Profile is getting more complex. Currently, we construct
a partial Profile and then use methods to slowly complete the structure.
This can hide dependencies and make refactoring fragile as the
requirements and outputs of the methods is not clearly specified.

Refactor construction to build the Profile only once all of the parts
are complete. The intermediate states explicitly pass input and outputs
as arguments.

Additionally, rename Profile.NodeMap to NamedEdgeMap to make its
contents more clear (edges, specified by caller/callee name rather than
IR). Remove the node flat/cumulative weight from this map; they are
unused.

Change-Id: I2079cd991daac6398d74375b04dfe120b473d908
Reviewed-on: https://go-review.googlesource.com/c/go/+/529558
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/pgo/irgraph.go