]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/ssa: on PPC64, merge (CMPconst [0] (op ...)) more aggressively
authorPaul E. Murphy <murp@ibm.com>
Tue, 24 Oct 2023 21:04:42 +0000 (16:04 -0500)
committerPaul Murphy <murp@ibm.com>
Mon, 13 Nov 2023 22:12:32 +0000 (22:12 +0000)
commit773039ed5c7b3721f7b14d33d608184b2598c7f4
tree54cd3a66cee65ca79920d030042e0cc42bd4234b
parent30de0b5ef4dda725f29fbdb88e1429a6dd3ae8cd
cmd/compile/internal/ssa: on PPC64, merge (CMPconst [0] (op ...)) more aggressively

Generate the CC version of many opcodes whose result is compared against
signed 0. The approach taken here works even if the opcode result is used in
multiple places too.

Add support for ADD, ADDconst, ANDN, SUB, NEG, CNTLZD, NOR conversions
to their CC opcode variant. These are the most commonly used variants.

Also, do not set clobberFlags of CNTLZD and CNTLZW, they do not clobber
flags.

This results in about 1% smaller text sections in kubernetes binaries,
and no regressions in the crypto benchmarks.

Change-Id: I9e0381944869c3774106bf348dead5ecb96dffda
Reviewed-on: https://go-review.googlesource.com/c/go/+/538636
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jayanth Krishnamurthy <jayanth.krishnamurthy@ibm.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/ssa/_gen/PPC64Ops.go
src/cmd/compile/internal/ssa/_gen/PPC64latelower.rules
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewritePPC64latelower.go
test/codegen/bool.go