cmd/compile: remove post-inlining PGO graph dump

The RedirectEdges logic is fragile and not quite complete (doesn't
update in-edges), which adds overhead to maintaining this package.

In my opinion, the post-inlining graph doesn't provide as much value as
the pre-inlining graph. Even the latter I am not convinced should be in
the compiler rather than an external tool, but it is comparatively
easier to maintain.

Drop it for now. Perhaps we'll want it back in the future for tracking
follow-up optimizations, but for now keep things simple.

Change-Id: I3133a2eb97893a14a6770547f96a3f1796798d17
Reviewed-on: https://go-review.googlesource.com/c/go/+/494655
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
This commit is contained in:
Michael Pratt 2023-05-12 11:54:47 -04:00
parent 4b6a542048
commit cce67690b8
2 changed files with 0 additions and 100 deletions

View file

@ -63,10 +63,6 @@ var (
// TODO(prattmic): Make this non-global.
candHotEdgeMap = make(map[pgo.CallSiteInfo]struct{})
// List of inlined call sites. CallSiteInfo.Callee is always nil.
// TODO(prattmic): Make this non-global.
inlinedCallSites = make(map[pgo.CallSiteInfo]struct{})
// Threshold in percentage for hot callsite inlining.
inlineHotCallSiteThresholdPercent float64
@ -158,23 +154,6 @@ func hotNodesFromCDF(p *pgo.Profile) (float64, []pgo.NodeMapKey) {
return 0, nodes
}
// pgoInlineEpilogue updates IRGraph after inlining.
func pgoInlineEpilogue(p *pgo.Profile, decls []ir.Node) {
if base.Debug.PGOInline >= 2 {
ir.VisitFuncsBottomUp(decls, func(list []*ir.Func, recursive bool) {
for _, f := range list {
name := ir.LinkFuncName(f)
if n, ok := p.WeightedCG.IRNodes[name]; ok {
p.RedirectEdges(n, inlinedCallSites)
}
}
})
// Print the call-graph after inlining. This is a debugging feature.
fmt.Printf("hot-cg after inline in dot:")
p.PrintWeightedCallGraphDOT(inlineHotCallSiteThresholdPercent)
}
}
// InlinePackage finds functions that can be inlined and clones them before walk expands them.
func InlinePackage(p *pgo.Profile) {
InlineDecls(p, typecheck.Target.Decls, true)
@ -223,10 +202,6 @@ func InlineDecls(p *pgo.Profile, decls []ir.Node, doInline bool) {
}
}
})
if p != nil {
pgoInlineEpilogue(p, decls)
}
}
// garbageCollectUnreferencedHiddenClosures makes a pass over all the
@ -1147,13 +1122,6 @@ func mkinlcall(n *ir.CallExpr, fn *ir.Func, bigCaller bool, inlCalls *[]*ir.Inli
fmt.Printf("%v: Before inlining: %+v\n", ir.Line(n), n)
}
if base.Debug.PGOInline > 0 {
csi := pgo.CallSiteInfo{LineOffset: pgo.NodeLineOffset(n, fn), Caller: ir.CurFunc}
if _, ok := inlinedCallSites[csi]; !ok {
inlinedCallSites[csi] = struct{}{}
}
}
res := InlineCall(n, fn, inlIndex)
if res == nil {