]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile: adjust PGO devirtualization diagnostic message
authorCherry Mui <cherryyz@google.com>
Mon, 5 Jun 2023 20:36:38 +0000 (16:36 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 6 Jun 2023 02:36:18 +0000 (02:36 +0000)
Make it more consistent with the static devirtualization
diagnostic message. Keep the print of concrete callee's method
name, as it is clearer.

Change-Id: Ibe9b40253eaff2c0071353a2b388177213488822
Reviewed-on: https://go-review.googlesource.com/c/go/+/500960
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/cmd/compile/internal/devirtualize/pgo.go
src/cmd/compile/internal/test/pgo_devirtualize_test.go

index 979483a46fd83b2b5a788a5088db5876a4bdabe4..a3402485430166208af69de2006b4c5a7685ecea 100644 (file)
@@ -265,7 +265,7 @@ func constructCallStat(p *pgo.Profile, fn *ir.Func, name string, call *ir.CallEx
 // concretetyp.
 func rewriteCondCall(call *ir.CallExpr, curfn, callee *ir.Func, concretetyp *types.Type) ir.Node {
        if base.Flag.LowerM != 0 {
-               fmt.Printf("%v: PGO devirtualizing call to %v\n", ir.Line(call), callee)
+               fmt.Printf("%v: PGO devirtualizing %v to %v\n", ir.Line(call), call.X, callee)
        }
 
        // We generate an OINCALL of:
index d524ddb3a20cbe6f0e15e7d1ee2a338b01b912a8..49e95e9a80385e2a2c6cd13b198747b3ac01de35 100644 (file)
@@ -68,7 +68,7 @@ go 1.19
 
        got := make(map[devirtualization]struct{})
 
-       devirtualizedLine := regexp.MustCompile(`(.*): PGO devirtualizing call to (.*)`)
+       devirtualizedLine := regexp.MustCompile(`(.*): PGO devirtualizing .* to (.*)`)
 
        scanner := bufio.NewScanner(pr)
        for scanner.Scan() {