]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: fold MOV*nop and MOV*const
authorKeith Randall <khr@golang.org>
Wed, 9 Dec 2020 22:59:40 +0000 (14:59 -0800)
committerKeith Randall <khr@golang.org>
Tue, 23 Feb 2021 20:05:01 +0000 (20:05 +0000)
commitd2911d76127deaa08644979cec7d990559f0aa54
treebbb8f48fbcbdebc660deb24f83d0961d4d2caa03
parentd434c2338b11b9ecf19865e8ec3f2721706f29cf
cmd/compile: fold MOV*nop and MOV*const

MOV*nop and MOV*reg seem superfluous. They are there to keep type
information around that would otherwise get thrown away. Not sure
what we need it for. I think our compiler needs a normalization of
how types are represented in SSA, especially after lowering.

MOV*nop gets in the way of some optimization rules firing, like for
load combining.

For now, just fold MOV*nop and MOV*const. It's certainly safe to
do that, as the type info on the MOV*const isn't ever useful.

R=go1.17

Change-Id: I3630a80afc2455a8e9cd9fde10c7abe05ddc3767
Reviewed-on: https://go-review.googlesource.com/c/go/+/276792
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/ARM.rules
src/cmd/compile/internal/ssa/gen/ARM64.rules
src/cmd/compile/internal/ssa/gen/MIPS.rules
src/cmd/compile/internal/ssa/gen/MIPS64.rules
src/cmd/compile/internal/ssa/gen/RISCV64.rules
src/cmd/compile/internal/ssa/rewriteARM.go
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteMIPS.go
src/cmd/compile/internal/ssa/rewriteMIPS64.go
src/cmd/compile/internal/ssa/rewriteRISCV64.go