From 376d9665a80e96f0b550c24be7ffedf0b467e40d Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 5 May 2016 11:45:27 -0700 Subject: [PATCH] =?utf8?q?cmd/compile:=20don=E2=80=99t=20consider=20recurs?= =?utf8?q?ive=20calls=20for=20inlining?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We will never inline recursive calls. Rather than simulate the recursion until we hit the complexity ceiling, just bail early. Also, remove a pointless n.Op check. visitBottomUp guarantees that n will be an ODCLFUNC, and caninl double-checks it. Change-Id: Ifa48331686b24289d34e68cf5bef385f464b6b92 Reviewed-on: https://go-review.googlesource.com/27462 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index b21daf5ff2..eeadc7e73e 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -438,10 +438,10 @@ func Main() { // Find functions that can be inlined and clone them before walk expands them. visitBottomUp(xtop, func(list []*Node, recursive bool) { for _, n := range list { - if n.Op == ODCLFUNC { + if !recursive { caninl(n) - inlcalls(n) } + inlcalls(n) } }) } -- 2.48.1