diff options
author | TennyZhuang <zty0826@gmail.com> | 2020-01-29 11:47:49 +0800 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2020-02-26 14:44:24 +0000 |
commit | ee46f135a92c982d1dfcfd742729df372d70a69c (patch) | |
tree | af4faf99418cd6757f5ad26bea26df84ae6c2f00 /test/inline_big.go | |
parent | 26aadfa0442249d4b55d7135134eb7ec0a43a850 (diff) | |
download | go-ee46f135a92c982d1dfcfd742729df372d70a69c.tar.gz go-ee46f135a92c982d1dfcfd742729df372d70a69c.zip |
cmd/compile: output cost while inlining function with Debug['m'] > 1
The existing implementation outputs inline cost iff function cannot be inlined with Debug['m'] > 1, the cost info is also useful if the function is inlineable.
Fixes #36780
Change-Id: Ic96f6baf96aee25fb4b33d31d4d644dc2310e536
Reviewed-on: https://go-review.googlesource.com/c/go/+/216778
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'test/inline_big.go')
-rw-r--r-- | test/inline_big.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/inline_big.go b/test/inline_big.go index b72ceb7f42..68e1101d3b 100644 --- a/test/inline_big.go +++ b/test/inline_big.go @@ -9,12 +9,12 @@ package foo -func small(a []int) int { // ERROR "can inline small as:.*" "a does not escape" +func small(a []int) int { // ERROR "can inline small with cost .* as:.*" "a does not escape" // Cost 16 body (need cost < 20). // See cmd/compile/internal/gc/inl.go:inlineBigFunction* return a[0] + a[1] + a[2] + a[3] } -func medium(a []int) int { // ERROR "can inline medium as:.*" "a does not escape" +func medium(a []int) int { // ERROR "can inline medium with cost .* as:.*" "a does not escape" // Cost 32 body (need cost > 20 and cost < 80). // See cmd/compile/internal/gc/inl.go:inlineBigFunction* return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7] |