]> Cypherpunks repositories - gostls13.git/commit
[dev.power64] 6g,8g: remove unnecessary and incorrect reg use scanning
authorAustin Clements <austin@google.com>
Thu, 13 Nov 2014 18:34:20 +0000 (13:34 -0500)
committerAustin Clements <austin@google.com>
Thu, 13 Nov 2014 18:34:20 +0000 (13:34 -0500)
commitc3dadb3d190973b888f5f83de3a3cccdbe7fc949
tree095d465ddf52915e9931e21c3f40e3184deefeeb
parent8c060d9392d44916588780fe976c888f3ba8a60e
[dev.power64] 6g,8g: remove unnecessary and incorrect reg use scanning

Previously, the 6g and 8g registerizers scanned for used
registers beyond the end of a region being considered for
registerization.  This ancient artifact was copied from the C
compilers, where it was probably necessary to track implicitly
used registers.  In the Go compilers it's harmless (because it
can only over-restrict the set of available registers), but no
longer necessary because the Go compilers correctly track
register use/set information.  The consequences of this extra
scan were (at least) that 1) we would not consider allocating
the AX register if there was a deferproc call in the future
because deferproc uses AX as a return register, so we see the
use of AX, but don't track that AX is set by the CALL, and 2)
we could not consider allocating the DX register if there was
a MUL in the future because MUL implicitly sets DX and (thanks
to an abuse of copyu in this code) we would also consider DX
used.

This commit fixes these problems by nuking this code.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/174110043
src/cmd/6g/reg.c
src/cmd/8g/reg.c