Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cmd/compile/internal/ssa/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,9 @@ var passes = [...]pass{
{name: "checkLower", fn: checkLower, required: true},
{name: "loop invariant", fn: licm},
{name: "late phielim and copyelim", fn: copyelim},
{name: "tighten", fn: tighten, required: true}, // move values closer to their uses
{name: "merge conditional branches", fn: mergeConditionalBranches}, // generate conditional comparison instructions on ARM64 architecture
{name: "tighten", fn: tighten, required: true}, // move values closer to their uses
// TODO: fix 80102 and re-enable.
//{name: "merge conditional branches", fn: mergeConditionalBranches}, // generate conditional comparison instructions on ARM64 architecture
{name: "late deadcode", fn: deadcode},
{name: "critical", fn: critical, required: true}, // remove critical edges
{name: "phi tighten", fn: phiTighten}, // place rematerializable phi args near uses to reduce value lifetimes
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
golang.org/x/sys v0.45.0
golang.org/x/telemetry v0.0.0-20260519152614-eab6ae52b5e2
golang.org/x/term v0.43.0
golang.org/x/tools v0.45.1-0.20260708165844-7044391f8d9f
golang.org/x/tools v0.45.1-0.20260710204130-3cdf838841de
)

require (
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
golang.org/x/tools v0.45.1-0.20260708165844-7044391f8d9f h1:+8KrHGzDDuO2MPZnvvvtdkjmT9N+WrPEqugH6wRHmL4=
golang.org/x/tools v0.45.1-0.20260708165844-7044391f8d9f/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
golang.org/x/tools v0.45.1-0.20260710204130-3cdf838841de h1:DAFpdvgVicTKCGgv6rwHZv1Nk1fRPM1r/yyTbH9XbaA=
golang.org/x/tools v0.45.1-0.20260710204130-3cdf838841de/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
rsc.io/markdown v0.0.0-20240306144322-0bf8f97ee8ef h1:mqLYrXCXYEZOop9/Dbo6RPX11539nwiCNBb1icVPmw8=
rsc.io/markdown v0.0.0-20240306144322-0bf8f97ee8ef/go.mod h1:8xcPgWmwlZONN1D9bjxtHEjrUtSEa3fakVF8iaewYKQ=
655 changes: 339 additions & 316 deletions src/cmd/vendor/golang.org/x/tools/internal/stdlib/deps.go

Large diffs are not rendered by default.

289 changes: 288 additions & 1 deletion src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/cmd/vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ golang.org/x/text/internal/tag
golang.org/x/text/language
golang.org/x/text/transform
golang.org/x/text/unicode/norm
# golang.org/x/tools v0.45.1-0.20260708165844-7044391f8d9f
# golang.org/x/tools v0.45.1-0.20260710204130-3cdf838841de
## explicit; go 1.25.0
golang.org/x/tools/cmd/bisect
golang.org/x/tools/cover
Expand Down
6 changes: 4 additions & 2 deletions src/reflect/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -2038,8 +2038,10 @@ func (v Value) OverflowUint(x uint64) bool {
//
// If v's Kind is [Func], the returned pointer is an underlying
// code pointer, but not necessarily enough to identify a
// single function uniquely. The only guarantee is that the
// result is zero if and only if v is a nil func Value.
// single function uniquely. In particular, functions with equal
// code pointers may not have identical behaviors when called.
// The only guarantee is that the result is zero if and only if
// v is a nil func Value.
//
// If v's Kind is [Slice], the returned pointer is to the first
// element of the slice. If the slice is nil the returned value
Expand Down
44 changes: 6 additions & 38 deletions test/codegen/comparisons.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ func CmpToZero_ex5(e, f int32, u uint32) int {

func UintLtZero(a uint8, b uint16, c uint32, d uint64) int {
// amd64: -`(TESTB|TESTW|TESTL|TESTQ|JCC|JCS)`
// arm64: -`(CMPW|CMP|CCMP|CCMPW|BHS|BLO)`
// arm64: -`(CMPW|CMP|BHS|BLO)`
if a < 0 || b < 0 || c < 0 || d < 0 {
return 1
}
Expand All @@ -471,77 +471,45 @@ func UintLtZero(a uint8, b uint16, c uint32, d uint64) int {

func UintGeqZero(a uint8, b uint16, c uint32, d uint64) int {
// amd64: -`(TESTB|TESTW|TESTL|TESTQ|JCS|JCC)`
// arm64: -`(CMPW|CMP|CCMP|CCMPW|BLO|BHS)`
// arm64: -`(CMPW|CMP|BLO|BHS)`
if a >= 0 || b >= 0 || c >= 0 || d >= 0 {
return 1
}
return 0
}

func UintGtZero(a uint8, b uint16, c uint32, d uint64) int {
// arm64: `(CMPW|CMP|CCMP|CCMPW|BNE|BEQ)`
// arm64: `(CBN?ZW)` `(CBN?Z[^W])` -`(CMPW|CMP|BLS|BHI)`
if a > 0 || b > 0 || c > 0 || d > 0 {
return 1
}
return 0
}

func UintLeqZero(a uint8, b uint16, c uint32, d uint64) int {
// arm64: `(CMPW|CMP|CCMP|CCMPW|BNE|BEQ)`
// arm64: `(CBN?ZW)` `(CBN?Z[^W])` -`(CMPW|CMP|BHI|BLS)`
if a <= 0 || b <= 0 || c <= 0 || d <= 0 {
return 1
}
return 0
}

func UintLtOne(a uint8, b uint16, c uint32, d uint64) int {
// arm64: `(CMPW|CMP|CCMP|CCMPW|BNE|BEQ)`
// arm64: `(CBN?ZW)` `(CBN?Z[^W])` -`(CMPW|CMP|BHS|BLO)`
if a < 1 || b < 1 || c < 1 || d < 1 {
return 1
}
return 0
}

func UintGeqOne(a uint8, b uint16, c uint32, d uint64) int {
// arm64: `(CMPW|CMP|CCMP|CCMPW|BNE|BEQ)`
// arm64: `(CBN?ZW)` `(CBN?Z[^W])` -`(CMPW|CMP|BLO|BHS)`
if a >= 1 || b >= 1 || c >= 1 || d >= 1 {
return 1
}
return 0
}

func ConditionalCompareUint8(a, b uint8) int {
// arm64:"CCMPW EQ, R[0-9]+, [$]1, [$]0"
if a == 1 && b == 1 {
return 1
}
return 0
}

func ConditionalCompareInt16(a, b int16) int {
// arm64:"CCMPW LE, R[0-9]+, R[0-9]+, [$]4"
if a > 3 || a == b {
return 1
}
return 0
}

func ConditionalCompareUint32(a, b uint32) int {
// arm64:"CCMPW LO, R[0-9]+, [$]28, [$]2"
if a > b && a < 28 {
return 1
}
return 0
}

func ConditionalCompareInt64(a, b int64) int {
// arm64:"CCMP GT, R[0-9]+, R[0-9]+, [$]0"
if a <= 16 || a != b {
return 1
}
return 0
}

func CmpToZeroU_ex1(a uint8, b uint16, c uint32, d uint64) int {
// wasm:"I64Eqz" -"I64LtU"
if 0 < a {
Expand Down
Loading