]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: allow inlining of functions with intrinsics in them
authorKeith Randall <khr@golang.org>
Sat, 10 Dec 2016 00:59:38 +0000 (16:59 -0800)
committerKeith Randall <khr@golang.org>
Thu, 2 Feb 2017 17:46:09 +0000 (17:46 +0000)
Intrinsics are ok to inline as they don't rewrite to actual calls.

Change-Id: Ieb19c834c61579823c62c6d1a1b425d6c4d4de23
Reviewed-on: https://go-review.googlesource.com/34272
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/inl.go

index 709578241192ff6acf3c7b04dd5ae3184ba683fa..04e24c1ef22394fdf78b1bea78ac04bf410fdaa8 100644 (file)
@@ -204,6 +204,10 @@ func ishairy(n *Node, budget *int32, reason *string) bool {
                        *budget -= fn.InlCost
                        break
                }
+               if isIntrinsicCall(n) {
+                       *budget--
+                       break
+               }
 
                if n.isMethodCalledAsFunction() {
                        if d := n.Left.Sym.Def; d != nil && d.Func.Inl.Len() != 0 {