Skip to content

[pull] master from golang:master - #193

Merged
pull[bot] merged 8 commits into
trailofbits:masterfrom
golang:master
Sep 2, 2026
Merged

[pull] master from golang:master#193
pull[bot] merged 8 commits into
trailofbits:masterfrom
golang:master

Conversation

@pull

@pull pull Bot commented Sep 2, 2026

Copy link
Copy Markdown

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 : )

adonovan and others added 8 commits September 1, 2026 11:41
(The next x/tools update would make this a vet error.)

Change-Id: I32a286cb28f177f33861be380a1d447664a0797c
Reviewed-on: https://go-review.googlesource.com/c/go/+/823829
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This CL tries to handle the relations of these value pairs:
v1 = w + delta1, v2 = w + delta2
Where delta1 and delta2 are const value.
If v1 and v2 are both non-overflowing/underflowing, they can establish a
relation based on the value of delta1 and delta2, i.e. if delta1 <
delta2, v1 < v2; if delta1 > delta2, v1 > v2.

Technically this could also be expanded to non-constant deltas, but we
need to walk `orderS` and `orderU` in that case, which is more work.

These patterns could be seen frequently in unrolled simd loops:
```
	for ; i <= n-128; i += 128 {
		v0 := archsimd.LoadUint8x32Slice(buf[i : i+32])
		v1 := archsimd.LoadUint8x32Slice(buf[i+32 : i+64])
		v2 := archsimd.LoadUint8x32Slice(buf[i+64 : i+96])
		v3 := archsimd.LoadUint8x32Slice(buf[i+96 : i+128])
		mask0 := v0.GreaterEqual(cA).And(v0.LessEqual(cZ))
		mask1 := v1.GreaterEqual(cA).And(v1.LessEqual(cZ))
		mask2 := v2.GreaterEqual(cA).And(v2.LessEqual(cZ))
		mask3 := v3.GreaterEqual(cA).And(v3.LessEqual(cZ))
		count0 += bits.OnesCount32(mask0.ToBits())
		count1 += bits.OnesCount32(mask1.ToBits())
		count2 += bits.OnesCount32(mask2.ToBits())
		count3 += bits.OnesCount32(mask3.ToBits())
	}
```

Fixes #79811.

Change-Id: I1f0a7e6869e9ef482680755b6832de9d5af82d92
Reviewed-on: https://go-review.googlesource.com/c/go/+/788440
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The convention of Concat is that if they are concatenating the elements, we put the Concat at the end.
Right now SaturateTo* is violating this convention, so changing it instead of Shifts.

Change-Id: Idbe2e0efd7133e420253d69138445af39c0dc1b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/825944
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: Junyang Shao <shaojunyang@google.com>
The induction variable min limits are only visible in the loop body
prior to this CL. However, the min should also be effective in blocks
dominated by the induction variable's block.

This CL makes that happen.

This change will benefit SIMD-unrolled loop followed by another SIMD
loop and a scalar tail loop pattern:

```
func CountUppercaseASCII_AVX2_Unrolled4(buf []byte) int {
	if !archsimd.X86.AVX2() {
		return CountUppercaseASCII_ScalarUnrolled4(buf)
	}
	cA := archsimd.BroadcastUint8x32('A')
	cZ := archsimd.BroadcastUint8x32('Z')
	count0 := 0
	count1 := 0
	count2 := 0
	count3 := 0
	i := 0
	n := len(buf)
	for ; i <= n-128; i += 128 {
		v0 := archsimd.LoadUint8x32Slice(buf[i : i+32])
		v1 := archsimd.LoadUint8x32Slice(buf[i+32 : i+64])
		v2 := archsimd.LoadUint8x32Slice(buf[i+64 : i+96])
		v3 := archsimd.LoadUint8x32Slice(buf[i+96 : i+128])
		mask0 := v0.GreaterEqual(cA).And(v0.LessEqual(cZ))
		mask1 := v1.GreaterEqual(cA).And(v1.LessEqual(cZ))
		mask2 := v2.GreaterEqual(cA).And(v2.LessEqual(cZ))
		mask3 := v3.GreaterEqual(cA).And(v3.LessEqual(cZ))
		count0 += bits.OnesCount32(mask0.ToBits())
		count1 += bits.OnesCount32(mask1.ToBits())
		count2 += bits.OnesCount32(mask2.ToBits())
		count3 += bits.OnesCount32(mask3.ToBits())
	}
	for ; i <= n-32; i += 32 {
		v := archsimd.LoadUint8x32Slice(buf[i : i+32])
		mask := v.GreaterEqual(cA).And(v.LessEqual(cZ))
		count0 += bits.OnesCount32(mask.ToBits())
	}
	if i < n {
		v := archsimd.LoadUint8x32SlicePart(buf[i:])
		mask := v.GreaterEqual(cA).And(v.LessEqual(cZ))
		count0 += bits.OnesCount32(mask.ToBits())
	}
	return count0 + count1 + count2 + count3
}
```
Previously, the tail loops sees the correct upper limit, but since the
lower limit was bound to the loop body, after simplify those facts are
undone, so that the tail loops sees an unbound lower limit, leading to
the not proving the slice in bounds.

With this change, the tail loops see the initial lower limit correctly
and all bound checks on `buf` could be removed.

Updates #79811.

Change-Id: Icfaec28d67161aa4f02667bfd5f091ed2a6f872c
Reviewed-on: https://go-review.googlesource.com/c/go/+/790961
Auto-Submit: 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>
Change-Id: Ic8183df73607fc877256b4e828f8c5796a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/819940
Reviewed-by: 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: David Chase <drchase@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
This cuts time spent in liveValues when compiling tsgo from 7.24s to 6.64s
according to pprof.

Change-Id: I7f2af1d5c35467c751341760a5d9aba26a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/805340
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
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>
Auto-Submit: Keith Randall <khr@golang.org>
We were packing the size into an int32, which isn't valid
for really large move/zero. Instead, put the alignment in the
aux field so we can use the entire auxint field for the size.

Fixes #81240
Fixes #81242

Change-Id: Ib5cc65b59dc4a26e729e38b56dec9e1137b15b50
Reviewed-on: https://go-review.googlesource.com/c/go/+/824984
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Julian Zhu <jz531210@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>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
The DeepCopier already set the position for copied LHS, the caller don't
have to do that anymore.

Fixes #81264

Change-Id: I9804e9ae95acb4390dce911110df828bb46e3742
Reviewed-on: https://go-review.googlesource.com/c/go/+/825524
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: Michael Pratt <mpratt@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
@pull pull Bot locked and limited conversation to collaborators Sep 2, 2026
@pull pull Bot added the ⤵️ pull label Sep 2, 2026
@pull
pull Bot merged commit f5a1204 into trailofbits:master Sep 2, 2026
9 checks passed
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.

5 participants