]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/ssa/gen: eliminate unnecessary neg and xori on PPC64
authorLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 14 Oct 2021 17:55:43 +0000 (12:55 -0500)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 21 Oct 2021 15:42:41 +0000 (15:42 +0000)
commit8b0bea993d452ef7861642a9c04bae213246ded1
tree5277943d2c8ee7e30742dff627ac635efead4975
parent8b9c0d1a79251969e46731e46e72e4e8f8998817
cmd/compile/internal/ssa/gen: eliminate unnecessary neg and xori on PPC64

This adds a few rules to PPC64 to eliminate some instructions:
- when an isel is used to generate a boolean value based on a
condition and followed by an xori to flip the result, it can
instead flip the operands in the isel and avoid the xori.
= when a neg follows a sub the operands to the sub can be
swapped and the neg avoided.

There are several opportunities in reflect.DeepEqual to omit
xori which improves some of its benchmarks by as much as
5%

Change-Id: I81bbc02c0f16995c65934b6f045867b731ab302b
Reviewed-on: https://go-review.googlesource.com/c/go/+/357509
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/ssa/gen/PPC64.rules
src/cmd/compile/internal/ssa/gen/PPC64Ops.go
src/cmd/compile/internal/ssa/rewritePPC64.go