]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: remove duplicate ppc64 rules
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 6 Feb 2020 18:36:29 +0000 (10:36 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 2 Mar 2020 21:59:19 +0000 (21:59 +0000)
commit37fc092be1ffe4906f67eae1c4c7be40f00f89ed
treec910cdf8d6914941ecd84caeca55e4ac7d959de5
parent63f1bc59922d454f288ad3d193bc60d7c980dbb0
cmd/compile: remove duplicate ppc64 rules

Const64 gets lowered to MOVDconst.
Change rules using interior Const64 to use MOVDconst instead,
to be less dependent on rule application order.

As a result of doing this, some of the rules end up being
exact duplicates; remove those.

We had those exact duplicates because of the order dependency;
ppc64 had no way to optimize away shifts by a constant
if the initial lowering didn't catch it.

Add those optimizations as well.
The outcome is the same, but this makes the overall rules more robust.

Change-Id: Iadd97a9fe73d52358d571d022ace145e506d160b
Reviewed-on: https://go-review.googlesource.com/c/go/+/220877
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/ssa/gen/PPC64.rules
src/cmd/compile/internal/ssa/gen/PPC64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewritePPC64.go