aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWayne Zuo <wdvxdr@golangcn.org>2022-09-15 15:14:52 +0800
committerGopher Robot <gobot@golang.org>2022-09-15 21:05:02 +0000
commit629c0b3a6e3e2ff11c9c989a8dcd1a538cdd76f4 (patch)
tree57d947bdb7fcf8980a83678eecf593c3e6912024 /src
parent5760fde4df4f1e9303de122ae3b5ac80b7ef681d (diff)
downloadgo-629c0b3a6e3e2ff11c9c989a8dcd1a538cdd76f4.tar.xz
cmd/compile: make encoding/binary appends cheaper to inline
Go 1.19 introduce new append-like APIs in package encoding/binary, this change teaches the inliner to treat calls to these methods as cheap, so that code using them will be more inlineable. Updates #42958 Change-Id: Ie3dd4906e285430f435bdedbf8a11fdffce9302d Reviewed-on: https://go-review.googlesource.com/c/go/+/431015 Auto-Submit: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Jenny Rakoczy <jenny@golang.org> Reviewed-by: Jenny Rakoczy <jenny@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Jenny Rakoczy <jenny@golang.org> Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/inline/inl.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/inline/inl.go b/src/cmd/compile/internal/inline/inl.go
index 817f2fd999..702b1d1cc5 100644
--- a/src/cmd/compile/internal/inline/inl.go
+++ b/src/cmd/compile/internal/inline/inl.go
@@ -304,7 +304,9 @@ func (v *hairyVisitor) doNode(n ir.Node) bool {
case "littleEndian.Uint64", "littleEndian.Uint32", "littleEndian.Uint16",
"bigEndian.Uint64", "bigEndian.Uint32", "bigEndian.Uint16",
"littleEndian.PutUint64", "littleEndian.PutUint32", "littleEndian.PutUint16",
- "bigEndian.PutUint64", "bigEndian.PutUint32", "bigEndian.PutUint16":
+ "bigEndian.PutUint64", "bigEndian.PutUint32", "bigEndian.PutUint16",
+ "littleEndian.AppendUint64", "littleEndian.AppendUint32", "littleEndian.AppendUint16",
+ "bigEndian.AppendUint64", "bigEndian.AppendUint32", "bigEndian.AppendUint16":
cheap = true
}
}