golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.02k stars 17.54k forks source link

cmd/compile: PGO-driven indirect call specialization #59959

Closed prattmic closed 1 year ago

prattmic commented 1 year ago

For instance, adding a conditional direct call to the concrete type of the hottest callee of an interface call.

Converting:

iface.Bar()

to

t, ok := iface.(Concrete)
if ok {
    t.Bar()
} else {
    iface.Bar()
}

This can enable inlining of the hot path. It won't affect escape analysis because the fallback path still escapes.

cc @cherrymui @aclements @rajbarik @jinlin-bayarea

gopherbot commented 1 year ago

Change https://go.dev/cl/492436 mentions this issue: WIP: cmd/compile: enable PGO-driven call specialization

gopherbot commented 1 year ago

Change https://go.dev/cl/494717 mentions this issue: DO NOT SUBMIT: cmd/pgo: specialization CallStat analysis tool

gopherbot commented 1 year ago

Change https://go.dev/cl/494716 mentions this issue: cmd/compile: replace -d=pgoinline with -d=pgodebug

gopherbot commented 1 year ago

Change https://go.dev/cl/494959 mentions this issue: cmd/compile/internal/typecheck: remove base.Errorf from Assignop

gopherbot commented 1 year ago

Change https://go.dev/cl/495915 mentions this issue: cmd/compile/internal/typecheck: export Implements

gopherbot commented 1 year ago

Change https://go.dev/cl/498263 mentions this issue: doc: release notes for PGO devirtualization

gopherbot commented 1 year ago

Change https://go.dev/cl/500155 mentions this issue: cmd/compile/internal/devirtualize: devirtualize methods in other packages if current package has a concrete reference