]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't rewrite (CMP (AND x y) 0) to TEST if AND has other uses
authorKeith Randall <khr@golang.org>
Tue, 7 Jul 2020 16:32:12 +0000 (09:32 -0700)
committerKeith Randall <khr@golang.org>
Mon, 17 Aug 2020 22:00:44 +0000 (22:00 +0000)
commitef9c8a38ad177fa7f48dfaad5d0e27f39a03529d
tree570eb06c97f9638080764d50a099e059e128a14e
parent8b8f926fc3f0e8f002d0a8e97aab9500e4db83a7
cmd/compile: don't rewrite (CMP (AND x y) 0) to TEST if AND has other uses

If the AND has other uses, we end up saving an argument to the AND
in another register, so we can use it for the TEST. No point in doing that.

Change-Id: I73444a6aeddd6f55e2328ce04d77c3e6cf4a83e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/241280
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go
test/codegen/logic.go [new file with mode: 0644]