diff options
| author | Than McIntosh <thanm@google.com> | 2023-01-03 13:11:10 -0500 |
|---|---|---|
| committer | Than McIntosh <thanm@google.com> | 2023-01-24 13:28:54 +0000 |
| commit | 733ba921875ea11088f1f447cbca418f651aae5c (patch) | |
| tree | 11d60bc069e31b46c7fe78d60157072bc50c57f4 /src/cmd/compile | |
| parent | 1951857ec07c1d491e1836770a647d3902934a67 (diff) | |
| download | go-733ba921875ea11088f1f447cbca418f651aae5c.tar.xz | |
cmd/compile: flag 'large' functions when -m=2+ in effect
When -m=N (where N > 1) is in effect, include a note in the trace
output if a given function is considered "big" during inlining
analysis, since this causes the inliner to be less aggressive. If a
small change to a large function happens to nudge it over the large
function threshold, it can be confusing for developers, thus it's
probably worth including this info in the remark output.
Change-Id: Id31a1b76371ab1ef9265ba28a377f97b0247d0a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/460317
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/cmd/compile')
| -rw-r--r-- | src/cmd/compile/internal/inline/inl.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go index 8620db2adb..e3b2e44f61 100644 --- a/src/cmd/compile/internal/inline/inl.go +++ b/src/cmd/compile/internal/inline/inl.go @@ -742,6 +742,9 @@ func InlineCalls(fn *ir.Func, profile *pgo.Profile) { ir.CurFunc = fn maxCost := int32(inlineMaxBudget) if isBigFunc(fn) { + if base.Flag.LowerM > 1 { + fmt.Printf("%v: function %v considered 'big'; revising maxCost from %d to %d\n", ir.Line(fn), fn, maxCost, inlineBigFunctionMaxCost) + } maxCost = inlineBigFunctionMaxCost } var inlCalls []*ir.InlinedCallExpr |
