You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/cmd/compile/internal/inline/inl.go
+135-3Lines changed: 135 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,13 @@ package inline
29
29
import (
30
30
"fmt"
31
31
"go/constant"
32
+
"strconv"
32
33
"strings"
33
34
34
35
"cmd/compile/internal/base"
35
36
"cmd/compile/internal/ir"
36
37
"cmd/compile/internal/logopt"
38
+
"cmd/compile/internal/pgo"
37
39
"cmd/compile/internal/typecheck"
38
40
"cmd/compile/internal/types"
39
41
"cmd/internal/obj"
@@ -42,17 +44,98 @@ import (
42
44
43
45
// Inlining budget parameters, gathered in one place
44
46
const (
45
-
inlineMaxBudget=80
46
-
inlineExtraAppendCost=0
47
+
inlineMaxBudget=80
48
+
// Budget increased due to hotness.
49
+
inlineHotCalleeMaxBudget=160
50
+
inlineExtraAppendCost=0
47
51
// default is to inline if there's at most one call. -l=4 overrides this by using 1 instead.
48
52
inlineExtraCallCost=57// 57 was benchmarked to provided most benefit with no bad surprises; see https://github.com/golang/go/issues/19348#issuecomment-439370742
49
53
inlineExtraPanicCost=1// do not penalize inlining panics.
50
54
inlineExtraThrowCost=inlineMaxBudget// with current (2018-05/1.11) code, inlining runtime.throw does not help.
51
55
52
56
inlineBigFunctionNodes=5000// Functions with this many nodes are considered "big".
53
57
inlineBigFunctionMaxCost=20// Max cost of inlinee when inlining into a "big" function.
58
+
54
59
)
55
60
61
+
var (
62
+
// Per-caller data structure to track the list of hot call sites. This gets rewritten every caller leaving it to GC for cleanup.
0 commit comments