Skip to content

[pull] master from golang:master#42

Merged
pull[bot] merged 25 commits into
trailofbits:masterfrom
golang:master
May 19, 2026
Merged

[pull] master from golang:master#42
pull[bot] merged 25 commits into
trailofbits:masterfrom
golang:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 19, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

cuishuang and others added 25 commits May 19, 2026 06:02
Replace if n > len(s)+1 { n = len(s)+1 } pattern with the more
concise min(n, len(s)+1) built-in function.

This reduces 3 lines of code and improves readability.

Change-Id: I20a17139e98548ef0e01aa00b13b0fb5927bcfd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/778740
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
A row can contain a "cursor", which is essentially a nested Rows.

Add a test for calling Rows.Close at various points of iterating over
nested Rows.

The implementation of cursors has some infelicities.
Add some comments documenting these.
Don't try to fix them at this time.

For #79407

Change-Id: I0010f89ccca352ca4eb54056f57cf5656a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/777960
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
…ed type

Prior to this CL, `string` is the only struct tag that applies
recursively to all fields within a composite type. This is new behavior
in v2.

With typed struct tags coming in the horizon, it increasingly looks like
most tag options would be non-recursive in nature (i.e., they only
affect the immediate field value), perhaps we a specific typed option
modifier to make an option recursive.

Thus we have decided to revert back to non-recursive behavior similar to
v1.

One motivation for making `string` recursive was mistakes and
surprise from users that applied the tag to composite types without
realizing it has no effect.

To help address this, placing `string` on a field with an unsupported
type now reports a runtime error rather than simply ignoring the tag.

StringifyWithLegacySemantics controls whether `string` supports bool and
string (as before), and ReportErrorsWithLegacySemantics controls type
error reporting. When true, type errors are suppressed. Note that this
means that v1 can opt-in to strict errors while keeping bool/string
support, and that v2 can suppress errors without adding bool/string
support.

Interaction with `format` is pretty awkward. time.Time with
`string,format:unix` outputs a stringified number, in spite of `string`
documentating stating that it only applies to numeric Go types. #79451
tracks reconsidering the behavior. Until then I have maintained the
original behavior.

There are tons of new tests, primarily due to the new error behavior.
The tests previously used a large with many different Go types, all with
`string`. Now a single type error would preclude testing of the other
types. So each type is split into its own test. Additionally, we need to
test the different combinations of StringifyWithLegacySemantics and
ReportErrorsWithLegacySemantics.

Fixes #79065.
Updates #79451.

Change-Id: If970138d65e4164619358009b2d41df06a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/779300
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Auto-Submit: Michael Pratt <mpratt@google.com>
The foldCondition op would allow folding if <ident> if we replaced
<ident> to true or false. Now we'll replace the ident in the if expr and
if the expr can be evaluated using boolean operations we can remove the
if or inline its body.

For #79286

Change-Id: Id90d372b3bdffcf2f6c4343f7a6c62e26a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/778980
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit generated by update.bash.

For #22487.

Change-Id: I7d6c780a39802c79bb8e6a5911a6748ac9920de4
Reviewed-on: https://go-review.googlesource.com/c/go/+/779663
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
If debug.malloc or gcBlackenEnabled are true or there is a secret, fall
back to a partially-specialized malloc function so we can shorten the
fast path function.

Some of the consts have been turned into vars but I've verified that the
compiler is still able to treat them as constants.

goos: linux
goarch: amd64
pkg: runtime
cpu: Intel(R) Xeon(R) Platinum 8481C CPU @ 2.70GHz
                                               │ 1_mqzmwsxo_11cd032288cb_runtime__mkmalloc__allow_for_folding_const_bool_exprs.txt │ 2_kpsrxxml_25246d9fd438_runtime__introduce_a_mallocgc_fast_path.txt │
                                               │                                      sec/op                                       │                   sec/op                     vs base                │
Mallocgc/scan=noscan/size=1/kind=new-88                                                                                5.935n ± 0%                                   4.848n ± 0%  -18.32% (p=0.000 n=10)
Mallocgc/scan=noscan/size=1/kind=mallocgc-88                                                                           7.610n ± 0%                                   7.791n ± 0%   +2.39% (p=0.000 n=10)
Mallocgc/scan=noscan/size=2/kind=new-88                                                                                5.979n ± 0%                                   5.303n ± 0%  -11.31% (p=0.000 n=10)
Mallocgc/scan=noscan/size=2/kind=mallocgc-88                                                                           7.373n ± 0%                                   7.004n ± 0%   -5.00% (p=0.000 n=10)
Mallocgc/scan=noscan/size=3/kind=new-88                                                                                7.418n ± 0%                                   6.432n ± 0%  -13.29% (p=0.000 n=10)
Mallocgc/scan=noscan/size=3/kind=mallocgc-88                                                                           8.513n ± 0%                                   8.188n ± 0%   -3.83% (p=0.000 n=10)
Mallocgc/scan=noscan/size=4/kind=new-88                                                                                7.918n ± 2%                                   7.162n ± 0%   -9.54% (p=0.000 n=10)
Mallocgc/scan=noscan/size=4/kind=mallocgc-88                                                                           8.907n ± 0%                                   9.048n ± 1%   +1.59% (p=0.000 n=10)
Mallocgc/scan=noscan/size=5/kind=new-88                                                                                8.828n ± 0%                                   8.335n ± 1%   -5.58% (p=0.000 n=10)
Mallocgc/scan=noscan/size=5/kind=mallocgc-88                                                                           9.564n ± 0%                                   9.944n ± 0%   +3.97% (p=0.000 n=10)
Mallocgc/scan=noscan/size=6/kind=new-88                                                                               10.340n ± 0%                                   9.640n ± 0%   -6.76% (p=0.000 n=10)
Mallocgc/scan=noscan/size=6/kind=mallocgc-88                                                                           11.31n ± 0%                                   11.76n ± 0%   +3.93% (p=0.000 n=10)
Mallocgc/scan=noscan/size=7/kind=new-88                                                                               10.805n ± 0%                                   9.853n ± 0%   -8.82% (p=0.000 n=10)
Mallocgc/scan=noscan/size=7/kind=mallocgc-88                                                                           11.39n ± 1%                                   11.94n ± 0%   +4.78% (p=0.000 n=10)
Mallocgc/scan=noscan/size=8/kind=new-88                                                                                9.976n ± 0%                                   9.204n ± 0%   -7.74% (p=0.000 n=10)
Mallocgc/scan=noscan/size=8/kind=mallocgc-88                                                                           10.97n ± 1%                                   11.24n ± 0%   +2.41% (p=0.000 n=10)
Mallocgc/scan=noscan/size=9/kind=new-88                                                                                15.23n ± 0%                                   14.74n ± 1%   -3.18% (p=0.000 n=10)
Mallocgc/scan=noscan/size=9/kind=mallocgc-88                                                                           16.36n ± 1%                                   17.14n ± 0%   +4.80% (p=0.000 n=10)
Mallocgc/scan=noscan/size=10/kind=new-88                                                                               14.99n ± 1%                                   15.23n ± 0%   +1.57% (p=0.000 n=10)
Mallocgc/scan=noscan/size=10/kind=mallocgc-88                                                                          16.20n ± 0%                                   17.65n ± 2%   +8.92% (p=0.000 n=10)
Mallocgc/scan=noscan/size=11/kind=new-88                                                                               15.19n ± 0%                                   14.72n ± 0%   -3.13% (p=0.000 n=10)
Mallocgc/scan=noscan/size=11/kind=mallocgc-88                                                                          16.39n ± 0%                                   17.13n ± 0%   +4.51% (p=0.000 n=10)
Mallocgc/scan=noscan/size=12/kind=new-88                                                                               15.08n ± 1%                                   14.59n ± 0%   -3.25% (p=0.000 n=10)
Mallocgc/scan=noscan/size=12/kind=mallocgc-88                                                                          16.61n ± 0%                                   18.32n ± 0%  +10.23% (p=0.000 n=10)
Mallocgc/scan=noscan/size=13/kind=new-88                                                                               16.61n ± 0%                                   14.68n ± 1%  -11.62% (p=0.000 n=10)
Mallocgc/scan=noscan/size=13/kind=mallocgc-88                                                                          16.46n ± 0%                                   17.20n ± 1%   +4.43% (p=0.000 n=10)
Mallocgc/scan=noscan/size=14/kind=new-88                                                                               16.14n ± 0%                                   14.42n ± 0%  -10.68% (p=0.000 n=10)
Mallocgc/scan=noscan/size=14/kind=mallocgc-88                                                                          16.78n ± 1%                                   17.27n ± 1%   +2.92% (p=0.000 n=10)
Mallocgc/scan=noscan/size=15/kind=new-88                                                                               15.76n ± 4%                                   14.96n ± 1%   -5.11% (p=0.000 n=10)
Mallocgc/scan=noscan/size=15/kind=mallocgc-88                                                                          17.02n ± 1%                                   17.11n ± 0%        ~ (p=0.254 n=10)
Mallocgc/scan=noscan/size=16/kind=new-88                                                                               14.37n ± 0%                                   13.61n ± 0%   -5.29% (p=0.000 n=10)
Mallocgc/scan=noscan/size=16/kind=mallocgc-88                                                                          15.54n ± 0%                                   15.01n ± 0%   -3.44% (p=0.000 n=10)
Mallocgc/scan=noscan/size=24/kind=new-88                                                                               17.32n ± 0%                                   16.12n ± 1%   -6.93% (p=0.000 n=10)
Mallocgc/scan=noscan/size=24/kind=mallocgc-88                                                                          18.73n ± 1%                                   17.78n ± 1%   -5.05% (p=0.000 n=10)
Mallocgc/scan=noscan/size=32/kind=new-88                                                                               19.31n ± 1%                                   18.84n ± 1%   -2.49% (p=0.000 n=10)
Mallocgc/scan=noscan/size=32/kind=mallocgc-88                                                                          20.66n ± 1%                                   20.14n ± 1%   -2.54% (p=0.000 n=10)
Mallocgc/scan=noscan/size=48/kind=new-88                                                                               25.30n ± 1%                                   24.33n ± 1%   -3.85% (p=0.000 n=10)
Mallocgc/scan=noscan/size=48/kind=mallocgc-88                                                                          26.33n ± 1%                                   25.46n ± 1%   -3.30% (p=0.000 n=10)
Mallocgc/scan=noscan/size=64/kind=new-88                                                                               30.68n ± 1%                                   29.88n ± 1%   -2.64% (p=0.000 n=10)
Mallocgc/scan=noscan/size=64/kind=mallocgc-88                                                                          31.61n ± 2%                                   30.87n ± 1%   -2.34% (p=0.000 n=10)
Mallocgc/scan=noscan/size=80/kind=new-88                                                                               36.79n ± 1%                                   36.39n ± 2%   -1.10% (p=0.000 n=10)
Mallocgc/scan=noscan/size=80/kind=mallocgc-88                                                                          37.58n ± 1%                                   37.19n ± 1%   -1.01% (p=0.001 n=10)
Mallocgc/scan=noscan/size=96/kind=new-88                                                                               43.05n ± 1%                                   42.66n ± 2%   -0.93% (p=0.012 n=10)
Mallocgc/scan=noscan/size=96/kind=mallocgc-88                                                                          43.95n ± 1%                                   42.88n ± 1%   -2.43% (p=0.000 n=10)
Mallocgc/scan=noscan/size=112/kind=new-88                                                                              49.27n ± 1%                                   48.20n ± 1%   -2.18% (p=0.000 n=10)
Mallocgc/scan=noscan/size=112/kind=mallocgc-88                                                                         49.60n ± 1%                                   48.98n ± 1%   -1.24% (p=0.001 n=10)
Mallocgc/scan=noscan/size=128/kind=new-88                                                                              55.36n ± 1%                                   54.47n ± 1%   -1.61% (p=0.002 n=10)
Mallocgc/scan=noscan/size=128/kind=mallocgc-88                                                                         55.86n ± 1%                                   54.61n ± 1%   -2.24% (p=0.001 n=10)
Mallocgc/scan=noscan/size=144/kind=new-88                                                                              64.25n ± 2%                                   63.83n ± 1%   -0.65% (p=0.035 n=10)
Mallocgc/scan=noscan/size=144/kind=mallocgc-88                                                                         64.56n ± 1%                                   63.58n ± 1%   -1.53% (p=0.009 n=10)
Mallocgc/scan=noscan/size=160/kind=new-88                                                                              71.33n ± 2%                                   70.41n ± 1%   -1.30% (p=0.005 n=10)
Mallocgc/scan=noscan/size=160/kind=mallocgc-88                                                                         70.84n ± 1%                                   69.48n ± 2%   -1.92% (p=0.000 n=10)
Mallocgc/scan=noscan/size=176/kind=new-88                                                                              78.52n ± 1%                                   76.81n ± 1%   -2.18% (p=0.000 n=10)
Mallocgc/scan=noscan/size=176/kind=mallocgc-88                                                                         78.21n ± 1%                                   76.46n ± 1%   -2.24% (p=0.001 n=10)
Mallocgc/scan=noscan/size=192/kind=new-88                                                                              83.06n ± 1%                                   82.32n ± 1%   -0.89% (p=0.003 n=10)
Mallocgc/scan=noscan/size=192/kind=mallocgc-88                                                                         82.46n ± 1%                                   80.95n ± 1%   -1.83% (p=0.001 n=10)
Mallocgc/scan=noscan/size=208/kind=new-88                                                                              91.20n ± 1%                                   89.90n ± 2%   -1.43% (p=0.000 n=10)
Mallocgc/scan=noscan/size=208/kind=mallocgc-88                                                                         90.59n ± 1%                                   88.98n ± 1%   -1.79% (p=0.000 n=10)
Mallocgc/scan=noscan/size=224/kind=new-88                                                                              95.21n ± 1%                                   93.02n ± 1%   -2.31% (p=0.000 n=10)
Mallocgc/scan=noscan/size=224/kind=mallocgc-88                                                                         95.38n ± 1%                                   92.83n ± 1%   -2.67% (p=0.000 n=10)
Mallocgc/scan=noscan/size=240/kind=new-88                                                                              103.6n ± 1%                                   101.8n ± 1%   -1.74% (p=0.000 n=10)
Mallocgc/scan=noscan/size=240/kind=mallocgc-88                                                                         103.8n ± 1%                                   100.7n ± 1%   -2.99% (p=0.000 n=10)
Mallocgc/scan=noscan/size=256/kind=new-88                                                                              110.5n ± 1%                                   107.4n ± 1%   -2.76% (p=0.000 n=10)
Mallocgc/scan=noscan/size=256/kind=mallocgc-88                                                                         111.6n ± 1%                                   107.7n ± 1%   -3.54% (p=0.000 n=10)
Mallocgc/scan=noscan/size=288/kind=new-88                                                                              121.0n ± 1%                                   118.5n ± 1%   -2.07% (p=0.000 n=10)
Mallocgc/scan=noscan/size=288/kind=mallocgc-88                                                                         121.1n ± 1%                                   117.7n ± 1%   -2.89% (p=0.000 n=10)
Mallocgc/scan=noscan/size=320/kind=new-88                                                                              135.0n ± 1%                                   131.1n ± 1%   -2.89% (p=0.000 n=10)
Mallocgc/scan=noscan/size=320/kind=mallocgc-88                                                                         133.8n ± 1%                                   130.7n ± 1%   -2.39% (p=0.000 n=10)
Mallocgc/scan=noscan/size=352/kind=new-88                                                                              153.2n ± 1%                                   148.8n ± 1%   -2.90% (p=0.000 n=10)
Mallocgc/scan=noscan/size=352/kind=mallocgc-88                                                                         152.0n ± 1%                                   148.0n ± 1%   -2.66% (p=0.000 n=10)
Mallocgc/scan=noscan/size=384/kind=new-88                                                                              158.3n ± 0%                                   154.4n ± 1%   -2.43% (p=0.000 n=10)
Mallocgc/scan=noscan/size=384/kind=mallocgc-88                                                                         158.3n ± 1%                                   153.3n ± 1%   -3.16% (p=0.000 n=10)
Mallocgc/scan=noscan/size=416/kind=new-88                                                                              174.2n ± 1%                                   170.0n ± 2%   -2.38% (p=0.000 n=10)
Mallocgc/scan=noscan/size=416/kind=mallocgc-88                                                                         174.5n ± 1%                                   169.6n ± 1%   -2.81% (p=0.000 n=10)
Mallocgc/scan=noscan/size=448/kind=new-88                                                                              182.3n ± 1%                                   177.2n ± 1%   -2.85% (p=0.000 n=10)
Mallocgc/scan=noscan/size=448/kind=mallocgc-88                                                                         181.8n ± 1%                                   177.7n ± 1%   -2.26% (p=0.000 n=10)
Mallocgc/scan=noscan/size=480/kind=new-88                                                                              205.0n ± 1%                                   198.6n ± 1%   -3.12% (p=0.000 n=10)
Mallocgc/scan=noscan/size=480/kind=mallocgc-88                                                                         205.2n ± 2%                                   200.2n ± 1%   -2.44% (p=0.000 n=10)
Mallocgc/scan=noscan/size=512/kind=new-88                                                                              217.3n ± 1%                                   211.7n ± 1%   -2.58% (p=0.000 n=10)
Mallocgc/scan=noscan/size=512/kind=mallocgc-88                                                                         217.8n ± 1%                                   214.9n ± 2%   -1.33% (p=0.007 n=10)
Mallocgc/scan=scan/size=8/kind=new-88                                                                                  11.63n ± 1%                                   11.21n ± 0%   -3.61% (p=0.000 n=10)
Mallocgc/scan=scan/size=8/kind=mallocgc-88                                                                             13.31n ± 0%                                   12.56n ± 0%   -5.63% (p=0.000 n=10)
Mallocgc/scan=scan/size=16/kind=new-88                                                                                 15.58n ± 0%                                   15.02n ± 3%   -3.63% (p=0.001 n=10)
Mallocgc/scan=scan/size=16/kind=mallocgc-88                                                                            16.95n ± 0%                                   16.20n ± 0%   -4.43% (p=0.000 n=10)
Mallocgc/scan=scan/size=24/kind=new-88                                                                                 19.78n ± 0%                                   18.33n ± 1%   -7.31% (p=0.000 n=10)
Mallocgc/scan=scan/size=24/kind=mallocgc-88                                                                            21.03n ± 0%                                   19.36n ± 0%   -7.94% (p=0.000 n=10)
Mallocgc/scan=scan/size=32/kind=new-88                                                                                 21.33n ± 1%                                   20.46n ± 0%   -4.08% (p=0.000 n=10)
Mallocgc/scan=scan/size=32/kind=mallocgc-88                                                                            22.54n ± 1%                                   21.56n ± 1%   -4.37% (p=0.000 n=10)
Mallocgc/scan=scan/size=48/kind=new-88                                                                                 28.44n ± 1%                                   26.74n ± 0%   -5.96% (p=0.000 n=10)
Mallocgc/scan=scan/size=48/kind=mallocgc-88                                                                            29.66n ± 1%                                   27.89n ± 1%   -5.95% (p=0.000 n=10)
Mallocgc/scan=scan/size=64/kind=new-88                                                                                 32.30n ± 1%                                   31.44n ± 1%   -2.69% (p=0.000 n=10)
Mallocgc/scan=scan/size=64/kind=mallocgc-88                                                                            33.40n ± 1%                                   32.15n ± 1%   -3.73% (p=0.000 n=10)
Mallocgc/scan=scan/size=80/kind=new-88                                                                                 39.29n ± 1%                                   38.26n ± 1%   -2.60% (p=0.000 n=10)
Mallocgc/scan=scan/size=80/kind=mallocgc-88                                                                            40.63n ± 1%                                   39.55n ± 1%   -2.65% (p=0.000 n=10)
Mallocgc/scan=scan/size=96/kind=new-88                                                                                 46.17n ± 1%                                   44.06n ± 1%   -4.58% (p=0.000 n=10)
Mallocgc/scan=scan/size=96/kind=mallocgc-88                                                                            46.75n ± 1%                                   45.33n ± 1%   -3.05% (p=0.000 n=10)
Mallocgc/scan=scan/size=112/kind=new-88                                                                                51.73n ± 1%                                   50.41n ± 1%   -2.54% (p=0.000 n=10)
Mallocgc/scan=scan/size=112/kind=mallocgc-88                                                                           52.17n ± 1%                                   50.71n ± 1%   -2.79% (p=0.000 n=10)
Mallocgc/scan=scan/size=128/kind=new-88                                                                                57.70n ± 1%                                   55.37n ± 1%   -4.03% (p=0.000 n=10)
Mallocgc/scan=scan/size=128/kind=mallocgc-88                                                                           57.74n ± 1%                                   56.22n ± 1%   -2.63% (p=0.000 n=10)
Mallocgc/scan=scan/size=144/kind=new-88                                                                                68.42n ± 1%                                   66.92n ± 1%   -2.19% (p=0.000 n=10)
Mallocgc/scan=scan/size=144/kind=mallocgc-88                                                                           67.12n ± 1%                                   66.14n ± 2%   -1.45% (p=0.000 n=10)
Mallocgc/scan=scan/size=160/kind=new-88                                                                                75.02n ± 2%                                   73.44n ± 1%   -2.11% (p=0.000 n=10)
Mallocgc/scan=scan/size=160/kind=mallocgc-88                                                                           74.08n ± 1%                                   72.42n ± 1%   -2.23% (p=0.000 n=10)
Mallocgc/scan=scan/size=176/kind=new-88                                                                                79.69n ± 1%                                   77.68n ± 2%   -2.52% (p=0.000 n=10)
Mallocgc/scan=scan/size=176/kind=mallocgc-88                                                                           79.82n ± 1%                                   78.87n ± 2%        ~ (p=0.089 n=10)
Mallocgc/scan=scan/size=192/kind=new-88                                                                                86.32n ± 1%                                   84.97n ± 2%   -1.56% (p=0.004 n=10)
Mallocgc/scan=scan/size=192/kind=mallocgc-88                                                                           85.43n ± 1%                                   84.10n ± 1%   -1.55% (p=0.000 n=10)
Mallocgc/scan=scan/size=208/kind=new-88                                                                                92.27n ± 1%                                   90.84n ± 1%   -1.55% (p=0.001 n=10)
Mallocgc/scan=scan/size=208/kind=mallocgc-88                                                                           92.55n ± 1%                                   90.42n ± 1%   -2.30% (p=0.000 n=10)
Mallocgc/scan=scan/size=224/kind=new-88                                                                               100.90n ± 1%                                   97.52n ± 1%   -3.35% (p=0.000 n=10)
Mallocgc/scan=scan/size=224/kind=mallocgc-88                                                                           99.86n ± 2%                                   96.97n ± 1%   -2.90% (p=0.000 n=10)
Mallocgc/scan=scan/size=240/kind=new-88                                                                                105.8n ± 1%                                   101.7n ± 1%   -3.78% (p=0.000 n=10)
Mallocgc/scan=scan/size=240/kind=mallocgc-88                                                                           105.5n ± 1%                                   102.1n ± 2%   -3.18% (p=0.000 n=10)
Mallocgc/scan=scan/size=256/kind=new-88                                                                                112.3n ± 1%                                   107.4n ± 1%   -4.32% (p=0.000 n=10)
Mallocgc/scan=scan/size=256/kind=mallocgc-88                                                                           111.9n ± 1%                                   107.8n ± 1%   -3.66% (p=0.000 n=10)
Mallocgc/scan=scan/size=288/kind=new-88                                                                                127.1n ± 1%                                   123.4n ± 0%   -2.95% (p=0.000 n=10)
Mallocgc/scan=scan/size=288/kind=mallocgc-88                                                                           127.8n ± 2%                                   123.8n ± 1%   -3.17% (p=0.000 n=10)
Mallocgc/scan=scan/size=320/kind=new-88                                                                                142.0n ± 1%                                   138.5n ± 2%   -2.50% (p=0.000 n=10)
Mallocgc/scan=scan/size=320/kind=mallocgc-88                                                                           141.8n ± 1%                                   137.8n ± 1%   -2.82% (p=0.000 n=10)
Mallocgc/scan=scan/size=352/kind=new-88                                                                                153.5n ± 1%                                   149.8n ± 0%   -2.44% (p=0.000 n=10)
Mallocgc/scan=scan/size=352/kind=mallocgc-88                                                                           153.2n ± 1%                                   149.5n ± 1%   -2.38% (p=0.000 n=10)
Mallocgc/scan=scan/size=384/kind=new-88                                                                                168.6n ± 1%                                   164.4n ± 1%   -2.46% (p=0.000 n=10)
Mallocgc/scan=scan/size=384/kind=mallocgc-88                                                                           166.6n ± 1%                                   163.5n ± 1%   -1.83% (p=0.000 n=10)
Mallocgc/scan=scan/size=416/kind=new-88                                                                                174.7n ± 1%                                   171.3n ± 2%   -1.92% (p=0.000 n=10)
Mallocgc/scan=scan/size=416/kind=mallocgc-88                                                                           173.6n ± 1%                                   171.1n ± 1%   -1.44% (p=0.001 n=10)
Mallocgc/scan=scan/size=448/kind=new-88                                                                                193.8n ± 1%                                   191.1n ± 1%   -1.39% (p=0.000 n=10)
Mallocgc/scan=scan/size=448/kind=mallocgc-88                                                                           192.0n ± 2%                                   191.2n ± 1%   -0.44% (p=0.039 n=10)
Mallocgc/scan=scan/size=480/kind=new-88                                                                                204.7n ± 1%                                   201.5n ± 1%   -1.51% (p=0.001 n=10)
Mallocgc/scan=scan/size=480/kind=mallocgc-88                                                                           206.3n ± 1%                                   200.9n ± 1%   -2.62% (p=0.000 n=10)
Mallocgc/scan=scan/size=512/kind=new-88                                                                                218.9n ± 1%                                   212.6n ± 1%   -2.90% (p=0.000 n=10)
Mallocgc/scan=scan/size=512/kind=mallocgc-88                                                                           217.8n ± 1%                                   214.5n ± 1%   -1.54% (p=0.000 n=10)
geomean                                                                                                                47.37n                                        46.07n        -2.73%

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_c2s16-perf_vs_parent-sizespecializedmalloc,gotip-linux-amd64_c3h88-perf_vs_parent-sizespecializedmalloc,gotip-linux-arm64_c4ah72-perf_vs_parent-sizespecializedmalloc,gotip-linux-arm64_c4as16-perf_vs_parent-sizespecializedmalloc
Change-Id: Ifa7822de630e3692f4753086871186af6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/776120
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Michael Matloob <matloob@golang.org>
Commit-Queue: Michael Matloob <matloob@golang.org>
…he const

This extends a pattern we already match for Add* to
- Sub
- Sub (with swapped arguments)
- Xor
- Com
- Neg
- Mul

This more or less equates to constant folding and is particularly hard to
benchmark objectively for the same reasons.

It is 1 or 3 (for mul) cycles faster in a microbenchmark.

However it may require constants that are harder to materialize.

We currently do not consider these drawbacks in generic.rules.

I didn't originally thought the o.Uses == 1 was required however
certain arches like PPC64 are able to merge the CMP into the operation
in limited conditions which are broken by this CL.

Also if o.Uses == 1 we aren't removing a user, we could extand the
liveness of o's argument, without removing o increasing register pressure.

The latency gains should be invisible on branches, maybe not if used by
CondSelect or CvtBoolToUint8, but don't bother with theses unproven
dices.

Change-Id: I4fe6b5149576d2549e1157e5cc891af9edb79d55
Reviewed-on: https://go-review.googlesource.com/c/go/+/750181
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
I didn't even tried benchmarking this, I doubt it can be measured.
I needed this to remove O(n²) behavior for code that calls
computeKnownBitsForShift as part of computing known bits for
add and sub.

Change-Id: I6bab20cd6b65fb389e345e5745d17c364fb3d233
Reviewed-on: https://go-review.googlesource.com/c/go/+/773840
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Change-Id: Ibb0b9a14d13347ccd33a77e98f485fdde2b99c7c
GitHub-Last-Rev: a2364f5
GitHub-Pull-Request: #79201
Reviewed-on: https://go-review.googlesource.com/c/go/+/774160
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Visualize the known bits on screen.

Change-Id: I9a291af21dbbde4a0c3a5be93be914e7a9850d61
Reviewed-on: https://go-review.googlesource.com/c/go/+/778080
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Updates #76477.

Change-Id: I58726393363f0dc5a83b8a215a9d854d1e0e2c78
Reviewed-on: https://go-review.googlesource.com/c/go/+/728922
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
…and StrHash.

This removes redundant loads and stores when hashing keys in specialized maps and avoids treating keys as address-taken, which previously caused unnecessary reloads inside the loop.

Also remove the separate strHashAES implementation and route string hashing through memHashAES directly, simplifying the AES hashing code paths.

Change-Id: I498ae9f437ad089df4298aa85f04a16c2ed6a5f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/776281
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
- removed significant amounts of code duplication
- added more test cases with differet scale factors
- added missing test cases for (valid) nil arguments

Follow-up on CL 729860.

Change-Id: I2cc01d3d9f9ab0541a50df484317dfd91a117ae3
Reviewed-on: https://go-review.googlesource.com/c/go/+/779520
Reviewed-by: Neal Patel <neal@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
This simply moves these two functions next/below the group of related
functions (i.e., Int.Divide is now with the other division functions).
This makes it easier to see its code in context when looking at the
source.

No other code changes.

Follow-up on CL 729860.

Change-Id: Iccfcd014507fa8a68a7d1290ba246b714f8a66a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/779540
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Neal Patel <neal@golang.org>
Reviewed-by: Neal Patel <nealpatel@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
When these env vars are set, load roots from on-disk, and don't use the
platform verifier.

Fixes #77865

Change-Id: I3183d1636238bed924252fe1288cfa263d17f61d
Reviewed-on: https://go-review.googlesource.com/c/go/+/776940
Reviewed-by: Neal Patel <nealpatel@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
work is the only command not in sorted order.

Change-Id: Ib5b1fe1c2f2fd374597652ddf601e3b56a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/769440
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Updates #78888

Change-Id: I33e2d386fa911c67f062e24f52891a3c6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/776708
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
When indentList counts multi-line elements to decide whether to indent
an expression list, composite literals and address-of-composite-literal
expressions (&T{...}) were counted. This inflated the count and caused
extra indentation in return statements with multiple composite literals.

Introduce isCompositeLitLike to identify such expressions and exclude
them from the multi-line element count in indentList.

Fixes #7195

Change-Id: I363a62592dad9c551a54fb47bf958f403fba3ab1
Reviewed-on: https://go-review.googlesource.com/c/go/+/752220
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Change-Id: I200a0df9c327a9876046f3fad99ac57b6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/779900
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
If a symbol is cloned to an external symbol in order to edit it
(e.g. to insert a trampoline), we need to keep track whether it is
a content hashed symbol, so we can set proper attributes in later
phases, in particular, for external linking.

This should fix the build failure on RISCV64, where there are a
lot more trampolines needed due to its small direct call range.
In theory, the same failure could occur on other platforms if a
call from a non-deduplicated closure needs a trampoline.

Fixes #79270.

Change-Id: I293194f4bf6bf152dc32e183ca32d92d62c0a4ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/779402
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Tested against Google Chrome Canary 150.0.7834.0.

The Client-TLSv10, Client-TLSv11, and Client-TLSv12 recordings need to
change because they are configured with a version range that includes
TLS 1.3 (even if the OpenSSL server selects the lower one), so they
include ML-DSA signature algorithms in the Client Hello. The
Client-TLSv13 and Server-TLSv13-ClientAuthRequested* recordings need to
change because they now advertise ML-DSA support.

Because of #79481, we need to regenerate all recordings anyway, so defer
doing so to the next CL 779662, to avoid churning twice and bloating the
git history.

Fixes #78888

Change-Id: I14e6a89b459166155261aa8fc0edb83c6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/776709
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
This was broken by the change in RSA keygen in CL 733440.

This is a lot of churn because it spills into the OpenSSL generated
testdata. If it happens again, we should hardcode the keys and only
generate the certificates instead.

Fixes #79481

Change-Id: Ic22f4fe819797c6a28e6a315d0463a746a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/779662
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Darwin supports libc calls directly from Go, there is no need to
implement them using C.

While here, use CFBundleCopyBundleURL instead of CFBundleCopyResourceURL
+ path manipulation to get the bundle root directory. The former is
the right API for the job.

The resulting code is a bit more involved than expected because libc
wrappers are implemented manually, rather than autogenerated. But
there are already a many handcrafted libc calls wrappers, so this
change doesn't make things much worse.

Change-Id: Ica72c98c05262ee692f6fca0762136abaefbca34
Reviewed-on: https://go-review.googlesource.com/c/go/+/769360
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This was already checked by crypto/rsa, so there should be no observable
change.

Change-Id: I2dfbfc7fd710a5782ab1d2eea8be8f5f6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/765642
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TestTokenStringAllocations verifies a behavior of the inliner. Skip the
test on the noopt builders, where inlining is disabled.

Fixes #79460
Fixes #79462
Fixes #79463
Fixes #79465
Fixes #79466
Fixes #79469
Fixes #79470
Fixes #79471
Fixes #79472

Change-Id: I848b2b7913c848aefa0ed788c984590c9207dafa
Reviewed-on: https://go-review.googlesource.com/c/go/+/779920
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
@pull pull Bot locked and limited conversation to collaborators May 19, 2026
@pull pull Bot added the ⤵️ pull label May 19, 2026
@pull pull Bot merged commit f22e6ba into trailofbits:master May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.