1
0
mirror of https://github.com/golang/go synced 2024-11-22 17:44:46 -07:00
go/src/cmp
khr@golang.org 1a0b86375f cmd/compile: remove redundant calls to cmpstring
The results of cmpstring are reuseable if the second call has the
same arguments and memory.

Note that this gets rid of cmpstring, but we still generate a
redundant </<= test and branch afterwards, because the compiler
doesn't know that cmpstring only ever returns -1,0,1.

Update #61725

Change-Id: I93a0d1ccca50d90b1e1a888240ffb75a3b10b59b
Reviewed-on: https://go-review.googlesource.com/c/go/+/578835
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-19 16:31:02 +00:00
..
cmp_test.go strings: intrinsify and optimize Compare 2024-04-04 23:39:07 +00:00
cmp.go cmd/compile: remove redundant calls to cmpstring 2024-04-19 16:31:02 +00:00