aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2024-10-26 14:19:32 -0700
committerKeith Randall <khr@golang.org>2024-10-29 16:46:48 +0000
commit4dcbb00be200bc1f88b534c311ed4289eb2fbdd5 (patch)
treece9db27b0c526acdba9240b50c85c931659366fb /src/runtime/string.go
parentf5526b56dbf45ce1f2e856f4aa78674dd0b5afe3 (diff)
downloadgo-4dcbb00be200bc1f88b534c311ed4289eb2fbdd5.tar.xz
cmd/compile: teach prove about min/max phi operations
If there is a phi that is computing the minimum of its two inputs, then we know the result of the phi is smaller than or equal to both of its inputs. Similarly for maxiumum (although max seems less useful). This pattern happens for the case n := copy(a, b) n is the minimum of len(a) and len(b), so with this optimization we know both n <= len(a) and n <= len(b). That extra information is helpful for subsequent slicing of a or b. Fixes #16833 Change-Id: Ib4238fd1edae0f2940f62a5516a6b363bbe7928c Reviewed-on: https://go-review.googlesource.com/c/go/+/622240 Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime/string.go')
0 files changed, 0 insertions, 0 deletions