Skip to content

Commit 956f648

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 173dce8 commit 956f648

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/compile/internal/gc

1 file changed

+1
-1
lines changed

src/cmd/compile/internal/gc/inl.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func (v *hairyVisitor) visit(n *Node) bool {
321321
}
322322

323323
if isIntrinsicCall(n) {
324-
v.budget--
324+
// Treat like any other node.
325325
break
326326
}
327327

0 commit comments

Comments
 (0)