From 8a9dc05312ece25aae057e618f3715208d201f8e Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 9 Dec 2016 16:59:38 -0800 Subject: [PATCH] cmd/compile: allow inlining of functions with intrinsics in them 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 TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/compile/internal/gc/inl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index 7095782411..04e24c1ef2 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -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 { -- 2.48.1