]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add PGO auto mode
authorCherry Mui <cherryyz@google.com>
Mon, 3 Oct 2022 23:07:39 +0000 (19:07 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 16 Nov 2022 22:12:54 +0000 (22:12 +0000)
commit32851587d1adeb07503c2b6168ab11f008972606
tree260b3deeff16a3fc909b672ec31c43c1328548fd
parent17de9e2d18a62e28bb8032b04d81835e7705d4c7
cmd/go: add PGO auto mode

Add "auto" mode for the -pgo build flag. When -pgo=auto is
specified, if there is a default.pgo file in the directory of the
main package, it will be selected and used for the build.

Currently it requires exactly one main package when -pgo=auto is
specified. (We'll support multiple main packages in the future.)

Also apply to other build-related subcommands, "go install", "go
run", "go test", and "go list".

For #55022.

Change-Id: Iab7974ab8932daf0e83506de505e044a8e412466
Reviewed-on: https://go-review.googlesource.com/c/go/+/438737
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/work/build.go
src/cmd/go/internal/work/init.go
src/cmd/go/testdata/script/build_pgo_auto.txt [new file with mode: 0644]