[go] cmd/compile: canonicalize [0,1] == 1 & [0,1] != 1 → != 0 & == 0

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
2:31 AM (15 hours ago) 2:31 AM
to Jorropo, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Carlos Amedee, Keith Randall, Keith Randall, Martin Möhrmann, golang-co...@googlegroups.com

Gopher Robot submitted the change with unreviewed changes

Unreviewed changes

4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: test/prove.go
Insertions: 8, Deletions: 0.

The diff is too large to show. Please review the diff.
```
```
The name of the file: src/cmd/compile/internal/ssa/prove.go
Insertions: 48, Deletions: 2.

The diff is too large to show. Please review the diff.
```

Change information

Commit message:
cmd/compile: canonicalize [0,1] == 1 & [0,1] != 1 → != 0 & == 0

Here are all the hits while building go:
archive/zip/reader.go:585:8: Rewrote v126 (Eq64) v37 argument is boolean-like; rewrote to Neq64 against 0
crypto/internal/fips140/aes/gcm/ghash.go:115:8: Rewrote v21 (Eq64) v11 argument is boolean-like; rewrote to Neq64 against 0
crypto/internal/fips140/mldsa/mldsa.go:68:86: Rewrote v89 (Eq64) v86 argument is boolean-like; rewrote to Neq64 against 0
crypto/internal/fips140/nistec/p256_asm.go:162:25: Rewrote v80 (Neq64) v76 argument is boolean-like; rewrote to Eq64 against 0
crypto/internal/fips140/nistec/p256_asm.go:266:22: Rewrote v113 (Neq64) v109 argument is boolean-like; rewrote to Eq64 against 0
crypto/internal/fips140/nistec/p256_asm.go:483:20: Rewrote v74 (Eq64) v69 argument is boolean-like; rewrote to Neq64 against 0
crypto/internal/fips140/nistec/p256_asm.go:521:20: Rewrote v76 (Eq64) v71 argument is boolean-like; rewrote to Neq64 against 0
crypto/internal/fips140/nistec/p256_asm.go:546:20: Rewrote v74 (Eq64) v69 argument is boolean-like; rewrote to Neq64 against 0
crypto/internal/fips140/rsa/keygen.go:22:27: Rewrote v45 (Eq64) v43 argument is boolean-like; rewrote to Neq64 against 0
crypto/internal/fips140/rsa/pkcs1v22.go:469:58: Rewrote v448 (Neq64) v447 argument is boolean-like; rewrote to Eq64 against 0
math/fma.go:170:55: Rewrote v349 (Eq64) v348 argument is boolean-like; rewrote to Neq64 against 0
net/http/h2_bundle.go:12020:11: Rewrote v233 (Eq64) v307 argument is boolean-like; rewrote to Neq64 against 0
time/time.go:1864:14: Rewrote v150 (Neq64) v149 argument is boolean-like; rewrote to Eq64 against 0

It optimize things like:
if bits < 2048 || bits%2 == 1 {
to:
if bits < 2048 || bits%2 != 0 {
Change-Id: Ic72e9212a44bf8b2d267bef0138249c66798dcba
Reviewed-by: Keith Randall <k...@golang.org>
Reviewed-by: Keith Randall <k...@google.com>
Auto-Submit: Jorropo <jorro...@gmail.com>
Reviewed-by: Carlos Amedee <car...@golang.org>
Files:
  • M src/cmd/compile/internal/ssa/prove.go
  • M test/prove.go
Change size: M
Delta: 2 files changed, 76 insertions(+), 7 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Keith Randall, +2 by Keith Randall, +1 by Carlos Amedee
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ic72e9212a44bf8b2d267bef0138249c66798dcba
Gerrit-Change-Number: 727241
Gerrit-PatchSet: 8
Gerrit-Owner: Jorropo <jorro...@gmail.com>
Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages