From 956f64888d650e870d03c533b47646cf911bc396 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 14 Feb 2020 11:42:58 -0800 Subject: [PATCH] cmd/compile: make inlining intrinsics cost one We were assigning a cost of 2 for intrinsics: One when we recognized an intrinsic, and one for the OCALLFUNC node. I believe that the intent was that intrinsics should cost 1, since they are typically an arithmetic op, and because they tend to occur in performance-sensitive code. (Not that any of this is particularly principled right now.) Stop charging when we recognize an intrinsic; let the OCALLFUNC node cover the cost. This has a negligible impact on std+cmd. Change-Id: Ie6ae5c18da3ae7e40aec425aed95c6999c2831a1 Reviewed-on: https://go-review.googlesource.com/c/go/+/221357 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/gc/inl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index f34193cb32..68acf876f8 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -321,7 +321,7 @@ func (v *hairyVisitor) visit(n *Node) bool { } if isIntrinsicCall(n) { - v.budget-- + // Treat like any other node. break } -- 2.50.0