]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: escape package path for PGO symbol matching
authorMichael Pratt <mpratt@google.com>
Fri, 28 Apr 2023 19:52:16 +0000 (15:52 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 28 Apr 2023 20:33:34 +0000 (20:33 +0000)
commit0fd6ae548f550bdbee4a434285ff052fb9dc7417
tree0ab63fdc3c231eaafa8da781d8c0667d8d271133
parent8b67cf0bc6ad657fddcbaaa10729d0086f08f9a9
cmd/compile: escape package path for PGO symbol matching

Symbol names in the final executable apply escaping to the final
component of a package path (main in example.com becomes
example%2ecom.main).

ir.PkgFuncName does not perform this escaping, meaning we'd fail to
match functions that are escaped in the profile.

Add ir.LinkFuncName which does perform escaping and use it for PGO.

Fixes #59887.

Change-Id: I10634d63d99d0a6fd2f72b929ab35ea227e1336f
Reviewed-on: https://go-review.googlesource.com/c/go/+/490555
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/pgo/irgraph.go