From fe69121bc538260cf91f11dab705335b690e51a3 Mon Sep 17 00:00:00 2001 From: Paschalis Tsilias Date: Wed, 13 Sep 2023 12:44:17 +0300 Subject: cmd/compile: optimize []byte(string1 + string2) This CL optimizes the compilation of string-to-bytes conversion in the case of string additions. Fixes #62407 Change-Id: Ic47df758478e5d061880620025c4ec7dbbff8a64 Reviewed-on: https://go-review.googlesource.com/c/go/+/527935 Reviewed-by: Cuong Manh Le Reviewed-by: Keith Randall Auto-Submit: Keith Randall LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Reviewed-by: Tim King --- src/cmd/internal/goobj/builtinlist.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/cmd/internal/goobj') diff --git a/src/cmd/internal/goobj/builtinlist.go b/src/cmd/internal/goobj/builtinlist.go index e2aae748a0..98a7fd0411 100644 --- a/src/cmd/internal/goobj/builtinlist.go +++ b/src/cmd/internal/goobj/builtinlist.go @@ -55,6 +55,11 @@ var builtins = [...]struct { {"runtime.concatstring4", 1}, {"runtime.concatstring5", 1}, {"runtime.concatstrings", 1}, + {"runtime.concatbyte2", 1}, + {"runtime.concatbyte3", 1}, + {"runtime.concatbyte4", 1}, + {"runtime.concatbyte5", 1}, + {"runtime.concatbytes", 1}, {"runtime.cmpstring", 1}, {"runtime.intstring", 1}, {"runtime.slicebytetostring", 1}, -- cgit v1.3-5-g9baa