commit | 4084bc1aa2af3ad479632c597458c6d9d1b2dec8 | [log] [tgz] |
---|---|---|
author | Michael Pratt <mpratt@google.com> | Wed Feb 28 15:25:40 2024 -0500 |
committer | Gopher Robot <gobot@golang.org> | Thu Apr 18 15:37:44 2024 +0000 |
tree | e79695629cade5c3432d7c9de225314ab2cf96a6 | |
parent | e718aee5f50b06d73ad4e679d0862267147347b0 [diff] |
cmd/go: inital plumbing for PGO profiles preprocessing The new go tool preprofile preprocesses a PGO pprof profile into an intermediate representation that is more efficient for the compiler to consume. Performing preprocessing avoids having every single compile process from duplicating the same processing. This CL prepares the initial plumbing to support automatic preprocessing by cmd/go. Each compile action takes a new dependency on a new "preprocess PGO profile" action. The same action instance is shared by all compile actions (assuming they have the same input profile), so the action only executes once. Builder.build retrieves the file to pass to -pgofile from the output of the preprocessing action, rather than directly from p.Internal.PGOProfile. Builder.buildActionID also uses the preprocess output as the PGO component of the cache key, rather than the original source. This doesn't matter for normal toolchain releases, as the two files are semantically equivalent, but it is useful for correct cache invalidation in development. For example, if _only_ go tool preprofile changes (potentially changing the output), then we must regenerate the output and then rebuild all packages. This CL does not actually invoke go tool preprocess. That will come in the next CL. For now, it just copies the input pprof profile. This CL shouldn't be submitted on its own, only with the children. Since the new action doesn't yet use the build cache, every build (even fully cached builds) unconditionally run the PGO action. For #58102. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Change-Id: I594417cfb0164cd39439a03977c904e4c0c83b8b Reviewed-on: https://go-review.googlesource.com/c/go/+/569423 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.