aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
AgeCommit message (Collapse)Author
2024-01-25all: prealloc slice with possible minimum capabilitiesShulhan
2024-01-23cmd/compile/internal/ssagen,runtime: merge trace consts into internal/abiqiulaidongfeng
For #59670 Change-Id: Iec85ee7312bb566b3f1224424f7d27bf4e408b13 GitHub-Last-Rev: c620abf9673e166505821d75717e820776abc302 GitHub-Pull-Request: golang/go#64905 Reviewed-on: https://go-review.googlesource.com/c/go/+/553295 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2024-01-23cmd/compile: use MapMaxKeyBytes,MapMaxElemBytes,MapBucketCount of internal/abiqiulaidongfeng
For #59670 Change-Id: I651e211650e69989c598ab16202105bc6e68d67e GitHub-Last-Rev: fba087a35fa563cba0dc5f70e8c9d9108dc1f1d4 GitHub-Pull-Request: golang/go#64776 Reviewed-on: https://go-review.googlesource.com/c/go/+/550615 Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-23cmd/compile: improve integer comparisons with numeric boundsJorropo
This do: - Fold always false or always true comparisons for ints and uint. - Reduce < and <= where the true set is only one value to == with such value. Change-Id: Ie9e3f70efd1845bef62db56543f051a50ad2532e Reviewed-on: https://go-review.googlesource.com/c/go/+/555135 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22Revert "cmd/preprofile: Add preprocess tool to pre-parse the profile file."Michael Pratt
This reverts CL 529738. Reason for revert: Breaking longtest builders For #58102. Fixes #65220. Change-Id: Id295e3249da9d82f6a9e4fc571760302a1362def Reviewed-on: https://go-review.googlesource.com/c/go/+/557460 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22cmd/preprofile: Add preprocess tool to pre-parse the profile file.Jin Lin
The pgo compilation time is very long if the profile file is large. We added a preprocess tool to pre-parse profile file in order to expedite the compile time. Change-Id: I6f50bbd01f242448e2463607a9b63483c6ca9a12 Reviewed-on: https://go-review.googlesource.com/c/go/+/529738 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-01-22cmd/compile: fix typo in commentRulin Tang
Change-Id: Ie3f1f194489dd4cfd995bfaf292e1c311b37597b GitHub-Last-Rev: 6a363297785187188923a76456b468ef1bc1a656 GitHub-Pull-Request: golang/go#65008 Reviewed-on: https://go-review.googlesource.com/c/go/+/554136 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Bypass: Robert Griesemer <gri@google.com>
2024-01-22cmd/compile/internal/ssa: fix typo in sccpWingrez
Change-Id: I7f522a4e1b0c50a469ce948249342d6e7cf7777c GitHub-Last-Rev: f89d7ee576814c6ebde823b68a0b64bba8c2ad8f GitHub-Pull-Request: golang/go#65188 Reviewed-on: https://go-review.googlesource.com/c/go/+/557255 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-22go/types, types2: typeparams.IndexExpr must not be an ast.ExprRob Findley
The typeparams.IndexExpr wrapper type was added as a compatibility layer to make the go/types code symmetric with types2. However, this type incidentally implemented the ast.Expr interface, leading to the accidental misuse that led to golang/go#63933. Fix this minimally for now, though leave a TODO that this old compatibility shim really needs to be eliminated. Also fix a case in types2 where operand.expr was set to a typed nil. Fixes golang/go#63933 Change-Id: I180d411e52f795a8322ecce6ed8649e88af1c63b Reviewed-on: https://go-review.googlesource.com/c/go/+/554395 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-18go/types, types2: fix range clause checks for constant range expressionsRobert Griesemer
Add missing checks for the case where the range expression is a (possibly untyped) constant integer expression. Add context parameter to assignVar for better error message where the expression is part of a range clause. Also, rename s/expr/Expr/ where it denotes an AST expression, for clarity. Fixes #65133. For #65137. Change-Id: I72962d76741abe79f613e251f7b060e99261d3ae Reviewed-on: https://go-review.googlesource.com/c/go/+/556398 Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
2024-01-17cmd/compile: call types2.Unalias to be ready for GODEBUG=gotypesalias=1Robert Griesemer
types2.Unalias is not needed if we know we have a core or underlying type. Also, types of declared functions (signatures) cannot be aliases (this includes tuples). Fixes #65125. Change-Id: I1faa26b66f6c646719e830dd661136fae86f3775 Reviewed-on: https://go-review.googlesource.com/c/go/+/556036 Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2024-01-11go/types, types2: don't lose position info of interface embeddingsRobert Griesemer
Accurate position information for embedded types in interfaces is crucial to identify the corresponding source file, and with that the Go language version associated with that file. (The position information is also important for proper error messages.) Before this CL, the position information for embedded types was discarded after type set computation, in the assumption that it was not needed anymore. However, substitutions that update the interface may lead to repeated type set computations which then won't have the correct position information. This CL does preserve the position information for embedded types until the end of type checking (cleanup phase), and also copy the position information during a substitution of the interface. The respective bug (#64759) doesn't seem to appear in 1.22 (most likely because it's hidden by some of the changes made with respect to the file version logic), but the existing code is still wrong. The backport of this code to 1.21 and 1.20 fixes the issue in those releases. For #64759. Change-Id: I80f4004c9d79cb02eac6739c324c477706615102 Reviewed-on: https://go-review.googlesource.com/c/go/+/555296 Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
2024-01-11cmd/compile: document go:wasmimport directiveMauri de Souza Meneguzzo
Fixes #64972 Change-Id: I784a8728afbdef9736681d56f0a79c82a00609d6 GitHub-Last-Rev: bf158dbeaaa495dc258c590c7a21cf9e25e76ee7 GitHub-Pull-Request: golang/go#64991 Reviewed-on: https://go-review.googlesource.com/c/go/+/554455 Reviewed-by: Achille Roussel <achille.roussel@gmail.com> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2024-01-10cmd/compile: use hashed symbol name for go.shape types if too longThan McIntosh
Shape-based stenciling in the Go compiler's generic instantiation phase looks up shape types using the underlying type of a given target type. This has a beneficial effect in most cases (e.g. we can use the same shape type for two different named types whose underlying type is "int"), but causes some problems when the underlying type is a very large structure. The link string for the underlying type of a large imported struct can be extremely long, since the link string essentially enumerates the full package path for every field type; this can produce a "go.shape.struct { ... " symbol name that is absurdly long. This patch switches the compiler to use a hash of the underlying type link string instead of the string itself, which should continue to provide commoning but keep symbol name lengths reasonable for shape types based on large imported structs. Fixes #65030. Change-Id: I87d602626c43172beb99c186b8ef72327b8227a2 Reviewed-on: https://go-review.googlesource.com/c/go/+/554975 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Than McIntosh <thanm@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2024-01-08cmd/compile: handle defined iter func type correctlyCuong Manh Le
Fixed #64930 Change-Id: I916de7f97116fb20cb2f3f0b425ac34409afd494 Reviewed-on: https://go-review.googlesource.com/c/go/+/553436 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2023-12-21cmd/compile: handle constant-folding of an out-of-range jump table indexKeith Randall
The input index to a jump table can be out of range for unreachable code. Dynamically the compiler ensures that an out-of-range index can never reach a jump table, but that guarantee doesn't extend to the static realm. Fixes #64826 Change-Id: I5829f3933ae5124ffad8337dfd7dd75e67a8ec33 Reviewed-on: https://go-review.googlesource.com/c/go/+/552055 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
2023-12-19cmd/compile: remove interfacecycles debug flagRobert Griesemer
Per the discussion on the issue, since no problems related to this appeared since Go 1.20, remove the ability to disable the check for anonymous interface cycles permanently. Adjust various tests accordingly. For #56103. Change-Id: Ica2b28752dca08934bbbc163a9b062ae1eb2a834 Reviewed-on: https://go-review.googlesource.com/c/go/+/550896 Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2023-12-15all: fix copyright headersJes Cok
Change-Id: Ib16986fb088030b93140e48c17e3d7bb2c9312cf GitHub-Last-Rev: 41572879f8f45c963c0e3ab9862bc0de59781a13 GitHub-Pull-Request: golang/go#64731 Reviewed-on: https://go-review.googlesource.com/c/go/+/549956 Run-TryBot: Jes Cok <xigua67damn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-12-14all: remove newline characters after return statementsDanil Timerbulatov
This commit is aimed at improving the readability and consistency of the code base. Extraneous newline characters were present after some return statements, creating unnecessary separation in the code. Fixes #64610 Change-Id: Ic1b05bf11761c4dff22691c2f1c3755f66d341f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/548316 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-12-13go/types, types2: report error for range over int if Go version < 1.22Robert Griesemer
Fixes #64704. Change-Id: Ied3af46ab534343cdafba5ee27680b9c6ef3d37a Reviewed-on: https://go-review.googlesource.com/c/go/+/549459 Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-12-13go/types, types2: better error message when missing method is unexportedRobert Griesemer
Change lookupMethod such that "foldCase" means "ignore case and package" and analyze a lookup result further to determine if a method name was not exported, and report a better error message in that case. Fixes #59831. Change-Id: Ice6222e1fc00dba13caeda6c48971e8473d12da5 Reviewed-on: https://go-review.googlesource.com/c/go/+/549298 Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
2023-12-13go/types, types2: avoid confusing error message "have m(T), want m(T)"Robert Griesemer
This is a partial fix for situations where a method lookup leads to an error due to non-matching signatures, but where the signatures print exactly the same. This can happen if both signatures contain type parameters (after instantiation) and the type parameters have the same name (such as "T"). For now, rather than printing a confusing error message in this case, leave away the confusing part of the error message (at the cost of providing slightly less information). In the long run, we need to find a better solution for this problem; but this seems better than what we had before. For #61685. Change-Id: I259183f08b9db400ffc8e1cf447967c640a0f444 Reviewed-on: https://go-review.googlesource.com/c/go/+/549296 Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Robert Griesemer <gri@google.com>
2023-12-12go/types, types2: flip message contents for reverse type inference errorsRobert Griesemer
Add a new flag 'reverse' to control the formatting of type inference error messages. This change only impacts error messages. Fixes #60747. Change-Id: I81e13075e3157252ccc09f358bd29bd676c34499 Reviewed-on: https://go-review.googlesource.com/c/go/+/549055 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-12-12go/types, types2: better error message for cases of reverse type inferenceRobert Griesemer
Introduce a new type "target" to pass around target types together with a suitable description (typically a variable name) for a better error message. As a side effect, using a specific type (target), rather than just Type avoids accidental confusion with other types. Use the target type description for a better error message in some cases. The error message can be further improved by flipping the order of the sentence (for another CL to keep this one small and simple). Also, and unrelated to this fix, remove the first argument to errorf in infer.go: the argument is always "type" (there's only one call). For #60747. Change-Id: I2118d0fe9e2b4aac959371941064e0e9ca7b3b6e Reviewed-on: https://go-review.googlesource.com/c/go/+/548995 Auto-Submit: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-12-08cmd/compile: fix error message for mismatch between the number of type ↵Raghvender
params and arguments Fixes #64276 Change-Id: Ib6651669904e6ea0daf275d85d8bd008b8b21cc6 Reviewed-on: https://go-review.googlesource.com/c/go/+/544018 Reviewed-by: raghvender sundarjee <raghvenders@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-12-08cmd/compile: fix SCCP propagation into jump tablesKeith Randall
We can't delete all the outgoing edges and then add one back in, because then we've lost the argument of any phi at the target. Instead, move the important target to the front of the list and delete the rest. This normally isn't a problem, because there is never normally a phi at the target of a jump table. But this isn't quite true when in race build mode, because there is a phi of the result of a bunch of raceread calls. The reason this happens is that each case is written like this (where e is the runtime.eface we're switching on): if e.type == $type.int32 { m = raceread(e.data, m1) } m2 = phi(m1, m) if e.type == $type.int32 { .. do case .. goto blah } so that if e.type is not $type.int32, it falls through to the default case. This default case will have a memory phi for all the (jumped around and not actually called) raceread calls. If we instead did it like if e.type == $type.int32 { raceread(e.data) .. do case .. goto blah } That would paper over this bug, as it is the only way to construct a jump table whose target is a block with a phi in it. (Yet.) But we'll fix the underlying bug in this CL. Maybe we can do the rewrite mentioned above later. (It is an optimization for -race mode, which isn't particularly important.) Fixes #64606 Change-Id: I6f6e3c90eb1e2638112920ee2e5b6581cef04ea4 Reviewed-on: https://go-review.googlesource.com/c/go/+/548356 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-12-07internal/profile: fully decode proto even if there are no samplesMichael Pratt
This is a partial revert of CL 483137. CL 483137 started checking errors in postDecode, which is good. Now we can catch more malformed pprof protos. However this made TestEmptyProfile fail, so an early return was added when the profile was "empty" (no samples). Unfortunately, this was problematic. Profiles with no samples can still be valid, but skipping postDecode meant that the resulting Profile was missing values from the string table. In particular, net/http/pprof needs to parse empty profiles in order to pass through the sample and period types to a final output proto. CL 483137 broke this behavior. internal/profile.Parse is only used in two places: in cmd/compile to parse PGO pprof profiles, and in net/http/pprof to parse before/after pprof profiles for delta profiles. In both cases, the input is never literally empty (0 bytes). Even a pprof proto with no samples still contains some header fields, such as sample and period type. Upstream github.com/google/pprof/profile even has an explicit error on 0 byte input, so `go tool pprof` will not support such an input. Thus TestEmptyProfile was misleading; this profile doesn't need to support empty input at all. Resolve this by removing TestEmptyProfile and replacing it with an explicit error on empty input, as upstream github.com/google/pprof/profile has. For non-empty input, always run postDecode to ensure the string table is processed. TestConvertCPUProfileEmpty is reverted back to assert the values from before CL 483137. Note that in this case "Empty" means no samples, not a 0 byte input. Continue to allow empty files for PGO in order to minimize the chance of last minute breakage if some users have empty files. Fixes #64566. Change-Id: I83a1f0200ae225ac6da0009d4b2431fe215b283f Reviewed-on: https://go-review.googlesource.com/c/go/+/547996 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-12-07go/types, types2: don't print aliased type (in comments) for Alias typesRobert Griesemer
Fixes #64584. Change-Id: I756d6026d10f130c1dd5026891b7cc3c640d7f78 Reviewed-on: https://go-review.googlesource.com/c/go/+/548135 Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com>
2023-12-05cmd/compile: fix escape analysis of string min/maxMatthew Dempsky
When I was plumbing min/max support through the compiler, I was thinking mostly about numeric argument types. As a result, I forgot that escape analysis would need to be aware that min/max can operate on string values, which contain pointers. Fixes #64565. Change-Id: I36127ce5a2da942401910fa0f9de922726c9f94d Reviewed-on: https://go-review.googlesource.com/c/go/+/547715 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-12-05math/rand, math/rand/v2: use ChaCha8 for global randRuss Cox
Move ChaCha8 code into internal/chacha8rand and use it to implement runtime.rand, which is used for the unseeded global source for both math/rand and math/rand/v2. This also affects the calculation of the start point for iteration over very very large maps (when the 32-bit fastrand is not big enough). The benefit is that misuse of the global random number generators in math/rand and math/rand/v2 in contexts where non-predictable randomness is important for security reasons is no longer a security problem, removing a common mistake among programmers who are unaware of the different kinds of randomness. The cost is an extra 304 bytes per thread stored in the m struct plus 2-3ns more per random uint64 due to the more sophisticated algorithm. Using PCG looks like it would cost about the same, although I haven't benchmarked that. Before this, the math/rand and math/rand/v2 global generator was wyrand (https://github.com/wangyi-fudan/wyhash). For math/rand, using wyrand instead of the Mitchell/Reeds/Thompson ALFG was justifiable, since the latter was not any better. But for math/rand/v2, the global generator really should be at least as good as one of the well-studied, specific algorithms provided directly by the package, and it's not. (Wyrand is still reasonable for scheduling and cache decisions.) Good randomness does have a cost: about twice wyrand. Also rationalize the various runtime rand references. goos: linux goarch: amd64 pkg: math/rand/v2 cpu: AMD Ryzen 9 7950X 16-Core Processor │ bbb48afeb7.amd64 │ 5cf807d1ea.amd64 │ │ sec/op │ sec/op vs base │ ChaCha8-32 1.862n ± 2% 1.861n ± 2% ~ (p=0.825 n=20) PCG_DXSM-32 1.471n ± 1% 1.460n ± 2% ~ (p=0.153 n=20) SourceUint64-32 1.636n ± 2% 1.582n ± 1% -3.30% (p=0.000 n=20) GlobalInt64-32 2.087n ± 1% 3.663n ± 1% +75.54% (p=0.000 n=20) GlobalInt64Parallel-32 0.1042n ± 1% 0.2026n ± 1% +94.48% (p=0.000 n=20) GlobalUint64-32 2.263n ± 2% 3.724n ± 1% +64.57% (p=0.000 n=20) GlobalUint64Parallel-32 0.1019n ± 1% 0.1973n ± 1% +93.67% (p=0.000 n=20) Int64-32 1.771n ± 1% 1.774n ± 1% ~ (p=0.449 n=20) Uint64-32 1.863n ± 2% 1.866n ± 1% ~ (p=0.364 n=20) GlobalIntN1000-32 3.134n ± 3% 4.730n ± 2% +50.95% (p=0.000 n=20) IntN1000-32 2.489n ± 1% 2.489n ± 1% ~ (p=0.683 n=20) Int64N1000-32 2.521n ± 1% 2.516n ± 1% ~ (p=0.394 n=20) Int64N1e8-32 2.479n ± 1% 2.478n ± 2% ~ (p=0.743 n=20) Int64N1e9-32 2.530n ± 2% 2.514n ± 2% ~ (p=0.193 n=20) Int64N2e9-32 2.501n ± 1% 2.494n ± 1% ~ (p=0.616 n=20) Int64N1e18-32 3.227n ± 1% 3.205n ± 1% ~ (p=0.101 n=20) Int64N2e18-32 3.647n ± 1% 3.599n ± 1% ~ (p=0.019 n=20) Int64N4e18-32 5.135n ± 1% 5.069n ± 2% ~ (p=0.034 n=20) Int32N1000-32 2.657n ± 1% 2.637n ± 1% ~ (p=0.180 n=20) Int32N1e8-32 2.636n ± 1% 2.636n ± 1% ~ (p=0.763 n=20) Int32N1e9-32 2.660n ± 2% 2.638n ± 1% ~ (p=0.358 n=20) Int32N2e9-32 2.662n ± 2% 2.618n ± 2% ~ (p=0.064 n=20) Float32-32 2.272n ± 2% 2.239n ± 2% ~ (p=0.194 n=20) Float64-32 2.272n ± 1% 2.286n ± 2% ~ (p=0.763 n=20) ExpFloat64-32 3.762n ± 1% 3.744n ± 1% ~ (p=0.171 n=20) NormFloat64-32 3.706n ± 1% 3.655n ± 2% ~ (p=0.066 n=20) Perm3-32 32.93n ± 3% 34.62n ± 1% +5.13% (p=0.000 n=20) Perm30-32 202.9n ± 1% 204.0n ± 1% ~ (p=0.482 n=20) Perm30ViaShuffle-32 115.0n ± 1% 114.9n ± 1% ~ (p=0.358 n=20) ShuffleOverhead-32 112.8n ± 1% 112.7n ± 1% ~ (p=0.692 n=20) Concurrent-32 2.107n ± 0% 3.725n ± 1% +76.75% (p=0.000 n=20) goos: darwin goarch: arm64 pkg: math/rand/v2 │ bbb48afeb7.arm64 │ 5cf807d1ea.arm64 │ │ sec/op │ sec/op vs base │ ChaCha8-8 2.480n ± 0% 2.429n ± 0% -2.04% (p=0.000 n=20) PCG_DXSM-8 2.531n ± 0% 2.530n ± 0% ~ (p=0.877 n=20) SourceUint64-8 2.534n ± 0% 2.533n ± 0% ~ (p=0.732 n=20) GlobalInt64-8 2.172n ± 1% 4.794n ± 0% +120.67% (p=0.000 n=20) GlobalInt64Parallel-8 0.4320n ± 0% 0.9605n ± 0% +122.32% (p=0.000 n=20) GlobalUint64-8 2.182n ± 0% 4.770n ± 0% +118.58% (p=0.000 n=20) GlobalUint64Parallel-8 0.4307n ± 0% 0.9583n ± 0% +122.51% (p=0.000 n=20) Int64-8 4.107n ± 0% 4.104n ± 0% ~ (p=0.416 n=20) Uint64-8 4.080n ± 0% 4.080n ± 0% ~ (p=0.052 n=20) GlobalIntN1000-8 2.814n ± 2% 5.643n ± 0% +100.50% (p=0.000 n=20) IntN1000-8 4.141n ± 0% 4.139n ± 0% ~ (p=0.140 n=20) Int64N1000-8 4.140n ± 0% 4.140n ± 0% ~ (p=0.313 n=20) Int64N1e8-8 4.140n ± 0% 4.139n ± 0% ~ (p=0.103 n=20) Int64N1e9-8 4.139n ± 0% 4.140n ± 0% ~ (p=0.761 n=20) Int64N2e9-8 4.140n ± 0% 4.140n ± 0% ~ (p=0.636 n=20) Int64N1e18-8 5.266n ± 0% 5.326n ± 1% +1.14% (p=0.001 n=20) Int64N2e18-8 6.052n ± 0% 6.167n ± 0% +1.90% (p=0.000 n=20) Int64N4e18-8 8.826n ± 0% 9.051n ± 0% +2.55% (p=0.000 n=20) Int32N1000-8 4.127n ± 0% 4.132n ± 0% +0.12% (p=0.000 n=20) Int32N1e8-8 4.126n ± 0% 4.131n ± 0% +0.12% (p=0.000 n=20) Int32N1e9-8 4.127n ± 0% 4.132n ± 0% +0.12% (p=0.000 n=20) Int32N2e9-8 4.132n ± 0% 4.131n ± 0% ~ (p=0.017 n=20) Float32-8 4.109n ± 0% 4.105n ± 0% ~ (p=0.379 n=20) Float64-8 4.107n ± 0% 4.106n ± 0% ~ (p=0.867 n=20) ExpFloat64-8 5.339n ± 0% 5.383n ± 0% +0.82% (p=0.000 n=20) NormFloat64-8 5.735n ± 0% 5.737n ± 1% ~ (p=0.856 n=20) Perm3-8 26.65n ± 0% 26.80n ± 1% +0.58% (p=0.000 n=20) Perm30-8 194.8n ± 1% 197.0n ± 0% +1.18% (p=0.000 n=20) Perm30ViaShuffle-8 156.6n ± 0% 157.6n ± 1% +0.61% (p=0.000 n=20) ShuffleOverhead-8 124.9n ± 0% 125.5n ± 0% +0.52% (p=0.000 n=20) Concurrent-8 2.434n ± 3% 5.066n ± 0% +108.09% (p=0.000 n=20) goos: linux goarch: 386 pkg: math/rand/v2 cpu: AMD Ryzen 9 7950X 16-Core Processor │ bbb48afeb7.386 │ 5cf807d1ea.386 │ │ sec/op │ sec/op vs base │ ChaCha8-32 11.295n ± 1% 4.748n ± 2% -57.96% (p=0.000 n=20) PCG_DXSM-32 7.693n ± 1% 7.738n ± 2% ~ (p=0.542 n=20) SourceUint64-32 7.658n ± 2% 7.622n ± 2% ~ (p=0.344 n=20) GlobalInt64-32 3.473n ± 2% 7.526n ± 2% +116.73% (p=0.000 n=20) GlobalInt64Parallel-32 0.3198n ± 0% 0.5444n ± 0% +70.22% (p=0.000 n=20) GlobalUint64-32 3.612n ± 0% 7.575n ± 1% +109.69% (p=0.000 n=20) GlobalUint64Parallel-32 0.3168n ± 0% 0.5403n ± 0% +70.51% (p=0.000 n=20) Int64-32 7.673n ± 2% 7.789n ± 1% ~ (p=0.122 n=20) Uint64-32 7.773n ± 1% 7.827n ± 2% ~ (p=0.920 n=20) GlobalIntN1000-32 6.268n ± 1% 9.581n ± 1% +52.87% (p=0.000 n=20) IntN1000-32 10.33n ± 2% 10.45n ± 1% ~ (p=0.233 n=20) Int64N1000-32 10.98n ± 2% 11.01n ± 1% ~ (p=0.401 n=20) Int64N1e8-32 11.19n ± 2% 10.97n ± 1% ~ (p=0.033 n=20) Int64N1e9-32 11.06n ± 1% 11.08n ± 1% ~ (p=0.498 n=20) Int64N2e9-32 11.10n ± 1% 11.01n ± 2% ~ (p=0.995 n=20) Int64N1e18-32 15.23n ± 2% 15.04n ± 1% ~ (p=0.973 n=20) Int64N2e18-32 15.89n ± 1% 15.85n ± 1% ~ (p=0.409 n=20) Int64N4e18-32 18.96n ± 2% 19.34n ± 2% ~ (p=0.048 n=20) Int32N1000-32 10.46n ± 2% 10.44n ± 2% ~ (p=0.480 n=20) Int32N1e8-32 10.46n ± 2% 10.49n ± 2% ~ (p=0.951 n=20) Int32N1e9-32 10.28n ± 2% 10.26n ± 1% ~ (p=0.431 n=20) Int32N2e9-32 10.50n ± 2% 10.44n ± 2% ~ (p=0.249 n=20) Float32-32 13.80n ± 2% 13.80n ± 2% ~ (p=0.751 n=20) Float64-32 23.55n ± 2% 23.87n ± 0% ~ (p=0.408 n=20) ExpFloat64-32 15.36n ± 1% 15.29n ± 2% ~ (p=0.316 n=20) NormFloat64-32 13.57n ± 1% 13.79n ± 1% +1.66% (p=0.005 n=20) Perm3-32 45.70n ± 2% 46.99n ± 2% +2.81% (p=0.001 n=20) Perm30-32 399.0n ± 1% 403.8n ± 1% +1.19% (p=0.006 n=20) Perm30ViaShuffle-32 349.0n ± 1% 350.4n ± 1% ~ (p=0.909 n=20) ShuffleOverhead-32 322.3n ± 1% 323.8n ± 1% ~ (p=0.410 n=20) Concurrent-32 3.331n ± 1% 7.312n ± 1% +119.50% (p=0.000 n=20) For #61716. Change-Id: Ibdddeed85c34d9ae397289dc899e04d4845f9ed2 Reviewed-on: https://go-review.googlesource.com/c/go/+/516860 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-12-04cmd/compile: update PGO profileCherry Mui
Since the default.pgo profile is collected, there has been a lot of development and refactoring in the compiler. It's time to refresh the compiler's PGO profile. As we are in the freeze, there will probably not be many major changes to the compiler, so this should be good for Go 1.22. Profile collected by running the cmd/compile/profile.sh script on the linux-amd64-perf gomote. Benchmark results on Linux/AMD64: │ nopgo.txt │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ sec/op vs base │ Template 127.4m ± 0% 125.3m ± 0% -1.65% (p=0.000 n=20) 123.5m ± 0% -3.07% (p=0.000 n=20) Unicode 105.94m ± 0% 100.77m ± 0% -4.87% (p=0.000 n=20) 99.26m ± 0% -6.30% (p=0.000 n=20) GoTypes 798.2m ± 1% 784.4m ± 0% -1.73% (p=0.000 n=20) 769.4m ± 1% -3.61% (p=0.000 n=20) Compiler 85.10m ± 0% 82.03m ± 1% -3.61% (p=0.000 n=20) 79.77m ± 1% -6.26% (p=0.000 n=20) SSA 6.054 ± 0% 5.945 ± 0% -1.81% (p=0.000 n=20) 5.811 ± 0% -4.03% (p=0.000 n=20) Flate 75.37m ± 1% 74.11m ± 0% -1.66% (p=0.000 n=20) 73.02m ± 1% -3.12% (p=0.000 n=20) GoParser 144.6m ± 1% 141.7m ± 1% -1.95% (p=0.000 n=20) 140.5m ± 1% -2.83% (p=0.000 n=20) Reflect 312.9m ± 1% 304.9m ± 1% -2.56% (p=0.000 n=20) 300.4m ± 0% -4.00% (p=0.000 n=20) Tar 115.8m ± 0% 113.6m ± 0% -1.88% (p=0.000 n=20) 111.9m ± 1% -3.33% (p=0.000 n=20) XML 145.9m ± 1% 143.6m ± 0% -1.58% (p=0.000 n=20) 141.3m ± 1% -3.15% (p=0.000 n=20) geomean 224.1m 218.9m -2.34% 215.2m -3.98% This also shows that a stale profile (the old one) still brings a speedup, but smaller, as expected. As before, the profile is transferrable. Benchmark results on Darwin/ARM64: │ nopgo.txt │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ sec/op vs base │ Template 71.31m ± 34% 68.97m ± 1% -3.28% (p=0.000 n=20) 68.66m ± 38% -3.71% (p=0.030 n=20) Unicode 58.70m ± 1% 55.64m ± 1% -5.20% (p=0.000 n=20) 53.05m ± 1% -9.61% (p=0.000 n=20) GoTypes 422.9m ± 0% 412.7m ± 0% -2.43% (p=0.000 n=20) 406.0m ± 1% -4.01% (p=0.000 n=20) Compiler 45.89m ± 1% 42.67m ± 2% -7.00% (p=0.000 n=20) 42.96m ± 1% -6.38% (p=0.000 n=20) SSA 3.190 ± 0% 3.090 ± 0% -3.15% (p=0.000 n=20) 3.007 ± 1% -5.74% (p=0.000 n=20) Flate 42.02m ± 1% 41.09m ± 1% -2.20% (p=0.000 n=20) 40.58m ± 1% -3.43% (p=0.000 n=20) GoParser 75.75m ± 1% 73.84m ± 1% -2.52% (p=0.000 n=20) 72.66m ± 1% -4.08% (p=0.000 n=20) Reflect 163.7m ± 1% 158.1m ± 1% -3.39% (p=0.000 n=20) 155.3m ± 1% -5.10% (p=0.000 n=20) Tar 62.03m ± 1% 60.15m ± 0% -3.02% (p=0.000 n=20) 59.74m ± 1% -3.69% (p=0.000 n=20) XML 79.38m ± 1% 77.32m ± 1% -2.59% (p=0.000 n=20) 75.05m ± 2% -5.45% (p=0.000 n=20) geomean 120.9m 116.6m -3.49% 114.6m -5.14% For #60234. Change-Id: I4ead6158f835c2e69c0f51ea24d044b82a7320cb Reviewed-on: https://go-review.googlesource.com/c/go/+/546337 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-12-01cmd/compile: correct code generation for right shifts on riscv64Joel Sing
The code generation on riscv64 will currently result in incorrect assembly when a 32 bit integer is right shifted by an amount that exceeds the size of the type. In particular, this occurs when an int32 or uint32 is cast to a 64 bit type and right shifted by a value larger than 31. Fix this by moving the SRAW/SRLW conversion into the right shift rules and removing the SignExt32to64/ZeroExt32to64. Add additional rules that rewrite to SRAIW/SRLIW when the shift is less than the size of the type, or replace/eliminate the shift when it exceeds the size of the type. Add SSA tests that would have caught this issue. Also add additional codegen tests to ensure that the resulting assembly is what we expect in these overflow cases. Fixes #64285 Change-Id: Ie97b05668597cfcb91413afefaab18ee1aa145ec Reviewed-on: https://go-review.googlesource.com/c/go/+/545035 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: M Zhuo <mzh@golangcn.org> Reviewed-by: Mark Ryan <markdryan@rivosinc.com> Run-TryBot: Joel Sing <joel@sing.id.au> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-12-01cmd/compile: fix typecheck range over rune literalCuong Manh Le
With range over int, the rune literal in range expression will be left as untyped rune, but idealType is not handling this case, causing ICE. Fixing this by setting the concrete type for untyped rune expresison. Fixes #64471 Change-Id: I07a151c54ea1d9e1b92e4d96cdfb6e73dca13862 Reviewed-on: https://go-review.googlesource.com/c/go/+/546296 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-11-30cmd/compile: fix memcombine pass for big endian, > 1 byte elementsKeith Randall
The shift amounts were wrong in this case, leading to miscompilation of load combining. Also the store combining was not triggering when it should. Fixes #64468 Change-Id: Iaeb08972c5fc1d6f628800334789c6af7216e87b Reviewed-on: https://go-review.googlesource.com/c/go/+/546355 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-11-30go/types: set correct Var.scopePos for parameters/resultsAlan Donovan
Previously, its value was unset (NoPos), but the correct value is a point after the signature (FuncType.End) and before the body. Also, fix a bug in Scope.Innermost whereby it would return the wrong (outer) scope when the query position was in the FuncType portion of a Func{Decl,Lit}. The fix is to set the scope's pos/end to those of the complete Func{Decl,Lit}. This is now documented at Info.Scopes, along with other missing information. Also, fix a bug in the go/types (but not types2) scope test, in which comments were discarded by the parser, causing the entire test to be a no-op (!). Also, make failures of TestScopeLookupParent more informative. Also, add a release note about the change in behavior. Fixes #64292 Fixes #64295 Change-Id: Ib681f59d1b0b43de977666db08302d7524d3305f Reviewed-on: https://go-review.googlesource.com/c/go/+/544035 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Run-TryBot: Robert Griesemer <gri@google.com>
2023-11-29types2, go/types: fix type checking of ~[]E passing to unsafe builtinsCuong Manh Le
Fixes #64406 Change-Id: I58002ad722a229fe6db0be08d745fbad86048c6d Reviewed-on: https://go-review.googlesource.com/c/go/+/545395 Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Robert Griesemer <gri@google.com>
2023-11-28cmd/compile: use correct type for slice pointerKeith Randall
The type of the data pointer field of a slice should be a pointer to the element type, not a *uint8. This ensures that the SSA value representing the slice's data pointer can be spilled to the stack slot for the corresponding argument. Before this change the types didn't match so we ended up spilling the argument to an autotmp instead of to the dedicated argument slot. Fixes #64414 Change-Id: I09ee39e93f05aee07e3eceb14e39736d7fd70a33 Reviewed-on: https://go-review.googlesource.com/c/go/+/545357 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com>
2023-11-27all: fix field namescui fliter
Change-Id: I3ad7a50707486ebdbbd676b3581df6e3ed0fd3a1 Reviewed-on: https://go-review.googlesource.com/c/go/+/543476 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: shuang cui <imcusg@gmail.com>
2023-11-22internal/abi, runtime, reflect, cmd: merge maxZero const into internal/abiqiulaidongfeng
For #59670 Change-Id: If38a74ad067a3ea3ff551c0c25c8ef41abec114b GitHub-Last-Rev: fb1f2f3c9f320017627bc3342b061e1e7f6f7fad GitHub-Pull-Request: golang/go#64268 Reviewed-on: https://go-review.googlesource.com/c/go/+/543655 Run-TryBot: qiulaidongfeng <2645477756@qq.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2023-11-21cmd/compile/internal/walk: copy SSA-able variablesMatthew Dempsky
order.go ensures expressions that are passed to the runtime by address are in fact addressable. However, in the case of local variables, if the variable hasn't already been marked as addrtaken, then taking its address here will effectively prevent the variable from being converted to SSA form. Instead, it's better to just copy the variable into a new temporary, which we can pass by address instead. This ensures the original variable can still be converted to SSA form. Fixes #63332. Change-Id: I182376d98d419df8bf07c400d84c344c9b82c0fb Reviewed-on: https://go-review.googlesource.com/c/go/+/541715 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com>
2023-11-21cmd/compile, internal/buildcfg: enable regABI on loong64, and add loong64 in ↵Guoqi Chen
test func hasRegisterABI goos: linux goarch: loong64 pkg: test/bench/go1 cpu: Loongson-3A5000 @ 2500.00MHz │ bench.old │ bench.new │ │ sec/op │ sec/op vs base │ Template 116.4m ± 1% 101.3m ± 0% -12.94% (p=0.000 n=20) Gzip 417.2m ± 0% 419.4m ± 0% +0.53% (p=0.000 n=20) Gunzip 87.41m ± 0% 84.61m ± 0% -3.20% (p=0.000 n=20) FmtFprintfEmpty 97.87n ± 0% 81.05n ± 0% -17.19% (p=0.000 n=20) FmtFprintfString 151.1n ± 0% 140.9n ± 0% -6.75% (p=0.000 n=20) FmtFprintfInt 155.6n ± 0% 143.0n ± 0% -8.10% (p=0.000 n=20) FmtFprintfIntInt 236.9n ± 0% 225.1n ± 0% -5.00% (p=0.000 n=20) FmtFprintfPrefixedInt 316.8n ± 0% 331.9n ± 0% +4.77% (p=0.000 n=20) FmtFprintfFloat 401.5n ± 0% 380.0n ± 0% -5.35% (p=0.000 n=20) FmtManyArgs 925.3n ± 0% 910.1n ± 0% -1.64% (p=0.000 n=20) BinaryTree17 14.04 ± 1% 12.84 ± 0% -8.52% (p=0.000 n=20) RegexpMatchEasy0_32 133.1n ± 0% 121.3n ± 0% -8.87% (p=0.000 n=20) RegexpMatchEasy0_1K 1.363µ ± 0% 1.337µ ± 0% -1.91% (p=0.000 n=20) RegexpMatchEasy1_32 162.7n ± 0% 152.6n ± 0% -6.24% (p=0.000 n=20) RegexpMatchEasy1_1K 1.505µ ± 0% 1.740µ ± 0% +15.61% (p=0.000 n=20) RegexpMatchMedium_32 1.429µ ± 0% 1.299µ ± 0% -9.10% (p=0.000 n=20) RegexpMatchMedium_1K 41.76µ ± 0% 38.16µ ± 0% -8.61% (p=0.000 n=20) RegexpMatchHard_32 2.094µ ± 0% 2.157µ ± 0% +3.01% (p=0.000 n=20) RegexpMatchHard_1K 63.25µ ± 0% 64.72µ ± 0% +2.33% (p=0.000 n=20) JSONEncode 18.00m ± 1% 17.46m ± 1% -3.05% (p=0.000 n=20) JSONDecode 79.49m ± 0% 72.42m ± 0% -8.89% (p=0.000 n=20) Revcomp 1.147 ± 0% 1.255 ± 0% +9.39% (p=0.000 n=20) Fannkuch11 3.623 ± 0% 3.410 ± 0% -5.87% (p=0.000 n=20) Fannkuch11 3.623 ± 0% 3.410 ± 0% -5.87% (p=0.000 n=20) GobDecode 14.26m ± 0% 12.92m ± 0% -9.36% (p=0.000 n=20) GobEncode 16.86m ± 1% 14.96m ± 0% -11.28% (p=0.000 n=20) GoParse 8.721m ± 0% 8.125m ± 1% -6.84% (p=0.000 n=20) Mandelbrot200 7.203m ± 0% 7.171m ± 0% -0.44% (p=0.000 n=20) HTTPClientServer 83.96µ ± 0% 80.83µ ± 0% -3.72% (p=0.000 n=20) TimeParse 415.3n ± 0% 389.1n ± 0% -6.31% (p=0.000 n=20) TimeFormat 506.4n ± 0% 495.9n ± 0% -2.06% (p=0.000 n=20) geomean 102.6µ 98.04µ -4.40% │ bench.old │ bench.new │ │ B/s │ B/s vs base │ Template 15.90Mi ± 1% 18.26Mi ± 0% +14.88% (p=0.000 n=20) Gzip 44.36Mi ± 0% 44.12Mi ± 0% -0.53% (p=0.000 n=20) Gunzip 211.7Mi ± 0% 218.7Mi ± 0% +3.31% (p=0.000 n=20) RegexpMatchEasy0_32 229.3Mi ± 0% 251.6Mi ± 0% +9.72% (p=0.000 n=20) RegexpMatchEasy0_1K 716.4Mi ± 0% 730.3Mi ± 0% +1.94% (p=0.000 n=20) RegexpMatchEasy1_32 187.6Mi ± 0% 200.0Mi ± 0% +6.64% (p=0.000 n=20) RegexpMatchEasy1_1K 649.1Mi ± 0% 561.3Mi ± 0% -13.52% (p=0.000 n=20) RegexpMatchMedium_32 21.35Mi ± 0% 23.50Mi ± 0% +10.05% (p=0.000 n=20) RegexpMatchMedium_1K 23.38Mi ± 0% 25.59Mi ± 0% +9.42% (p=0.000 n=20) RegexpMatchHard_32 14.57Mi ± 0% 14.14Mi ± 0% -2.95% (p=0.000 n=20) RegexpMatchHard_1K 15.44Mi ± 0% 15.09Mi ± 0% -2.29% (p=0.000 n=20) JSONEncode 102.8Mi ± 1% 106.0Mi ± 1% +3.15% (p=0.000 n=20) JSONDecode 23.28Mi ± 0% 25.55Mi ± 0% +9.75% (p=0.000 n=20) Revcomp 211.3Mi ± 0% 193.1Mi ± 0% -8.58% (p=0.000 n=20) GobDecode 51.34Mi ± 0% 56.64Mi ± 0% +10.33% (p=0.000 n=20) GobEncode 43.42Mi ± 1% 48.93Mi ± 0% +12.71% (p=0.000 n=20) GoParse 6.337Mi ± 0% 6.800Mi ± 1% +7.30% (p=0.000 n=20) geomean 61.24Mi 63.63Mi +3.91% Update #40724 Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: I5993460da8c5926c70cb6fbe551b8e4655dea9d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/521790 Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-11-21cmd/compile/internal/inline: revise -m=2 status messagesThan McIntosh
This patch revises the compiler's "-m=2" status messages related to inlining. The "can inline" remarks will continue to use the same format, but the remarks when a specific call site is inlined will be changed to refer to the score used; before we had runtime/traceback.go:1131:28: inlining call to gotraceback runtime/traceback.go:1183:25: inlining call to readgstatus and with GOEXPERIMENT=newinliner the new messages will be: runtime/traceback.go:1131:28: inlining call to gotraceback with score 62 runtime/traceback.go:1183:25: inlining call to readgstatus with score 9 Change-Id: Ia86cf5351d29eda64a5426ca0a2a2ec0c2900d81 Reviewed-on: https://go-review.googlesource.com/c/go/+/540775 Reviewed-by: Matthew Dempsky <mdempsky@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-11-21cmd/compile: fix If lowering on loong64Guoqi Chen
Update #40724 Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: I44477e32db765e0299d8361bd2b8d2c95564ed28 Reviewed-on: https://go-review.googlesource.com/c/go/+/521788 Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: David Chase <drchase@google.com> Auto-Submit: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-11-21cmd/compile: update loong64 CALL* opsGuoqi Chen
allow the loong64 CALL* ops to take variable number of args Update #40724 Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: I4706d9651fcbf9a0f201af6820c97b1a924f14e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/521781 Auto-Submit: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: David Chase <drchase@google.com>
2023-11-21cmd/compile/internal: add spill support for loong64 regABIGuoqi Chen
Update #40724 Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: Ic01d59bd81420b89c6d4b90c5975bf069d08e7cc Reviewed-on: https://go-review.googlesource.com/c/go/+/521780 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com>
2023-11-21cmd/compile/internal: add register info for loong64 regABIGuoqi Chen
Update #40724 Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: Ifd7d94147b01e4fc83978b53dca2bcc0ad1ac4e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/521779 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn>
2023-11-21cmd/compile,cmd/internal,runtime: change registers on loong64 to avoid ↵Guoqi Chen
regABI arguments Update #40724 Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: Ic7e2e7fb4c1d3670e6abbfb817aa6e4e654e08d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/521777 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com>
2023-11-21cmd/compile: add ABI register definations for loong64Guoqi Chen
Updates #40724 Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn> Change-Id: I56f7382dda58a565b8c3256f1c7845a3031f67de Reviewed-on: https://go-review.googlesource.com/c/go/+/521776 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: David Chase <drchase@google.com> Auto-Submit: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-11-21cmd/compile: teach regalloc to rightly do nothing on loong64 in case of ↵WANG Xuerui
dynlinking This is needed before actual support for buildmode=plugin is added. Should not affect current behavior. Change-Id: I86371d7e373fd529cb8710850d7b0fbbf1eb52ca Reviewed-on: https://go-review.googlesource.com/c/go/+/480877 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: WANG Xuerui <git@xen0n.name> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-11-21cmd/internal/obj,cmd/link: access global data via GOT in -dynlink mode on ↵Guoqi Chen
loong64 Updates #58784 Change-Id: Ic98d10a512fea0c3ca321ab52693d9f6775126a6 Reviewed-on: https://go-review.googlesource.com/c/go/+/480875 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: WANG Xuerui <git@xen0n.name> Reviewed-by: WANG Xuerui <git@xen0n.name>