]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add -pgo build flag
authorCherry Mui <cherryyz@google.com>
Wed, 28 Sep 2022 22:50:01 +0000 (18:50 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 8 Nov 2022 18:50:59 +0000 (18:50 +0000)
commit4b43b741710eb87cbae25f19cbde7eb733b08df1
tree710192defbea90f565a646011e95925690fafcb6
parent41795528b0132170ec70a8e8ce0bcdb2e972e074
cmd/go: add -pgo build flag

Add a -pgo flag for "go build" (and other build actions), to
specify the file path of a profile used for PGO. Special name
"off" turns off PGO.

The given profile path is passed to the compiler.

The build cache is sensitive to the content of the given PGO
profile.

TODO: auto mode.

For #55022.

Change-Id: Ieee1b131b4c041f9502fd0a1acf112f3e44246be
Reviewed-on: https://go-review.googlesource.com/c/go/+/438736
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/work/build.go
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/gc.go
src/cmd/go/internal/work/init.go
src/cmd/go/testdata/script/build_pgo.txt [new file with mode: 0644]