]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/inline/inl.go
cmd/compile/internal/inline: tweak "returns inlinable func" heuristic
[gostls13.git] / src / cmd / compile / internal / inline / inl.go
index 6765e199d067e329405edeff5fca4e6aa62c22d8..992ae632e272c0dab23a4bab4770cca24a79a248 100644 (file)
@@ -149,7 +149,7 @@ func InlinePackage(p *pgo.Profile) {
        garbageCollectUnreferencedHiddenClosures()
 
        if base.Debug.DumpInlFuncProps != "" {
-               inlheur.DumpFuncProps(nil, base.Debug.DumpInlFuncProps, nil)
+               inlheur.DumpFuncProps(nil, base.Debug.DumpInlFuncProps, nil, inlineMaxBudget)
        }
        if goexperiment.NewInliner {
                postProcessCallSites(p)
@@ -283,8 +283,8 @@ func CanInline(fn *ir.Func, profile *pgo.Profile) {
 
        var funcProps *inlheur.FuncProps
        if goexperiment.NewInliner || inlheur.UnitTesting() {
-               funcProps = inlheur.AnalyzeFunc(fn,
-                       func(fn *ir.Func) { CanInline(fn, profile) })
+               callCanInline := func(fn *ir.Func) { CanInline(fn, profile) }
+               funcProps = inlheur.AnalyzeFunc(fn, callCanInline, inlineMaxBudget)
        }
 
        var reason string // reason, if any, that the function was not inlined
@@ -802,7 +802,7 @@ func InlineCalls(fn *ir.Func, profile *pgo.Profile) {
        }
        if base.Debug.DumpInlFuncProps != "" && !fn.Wrapper() {
                inlheur.DumpFuncProps(fn, base.Debug.DumpInlFuncProps,
-                       func(fn *ir.Func) { CanInline(fn, profile) })
+                       func(fn *ir.Func) { CanInline(fn, profile) }, inlineMaxBudget)
        }
        savefn := ir.CurFunc
        ir.CurFunc = fn