From: Josh Bleecher Snyder Date: Thu, 5 May 2016 18:45:27 +0000 (-0700) Subject: cmd/compile: don’t consider recursive calls for inlining X-Git-Tag: go1.8beta1~1742 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=376d9665a80e96f0b550c24be7ffedf0b467e40d;p=gostls13.git cmd/compile: don’t consider recursive calls for inlining 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 --- 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) } }) }