cmd/compile: better propagation of desired registers
cmd/compile: better propagation of desired registers

This fixes two independent problems:

We normally propagate desired registers backwards through opcodes that
are marked resultInArg0. Unfortunately for the desired register
computation, ADDQconst is not marked as resultInArg0. This is because
the amd64 backend can write it out as LEAQ instead if the input and
output registers don't match. For desired register purposes, we want
to treat ADDQconst as resultInArg0, so that we get an ADDQ instead of
a LEAQ if we can.

Desired registers don't currently work for tuple-generating opcodes.
Declare that the desired register applies to the first element of the
tuple, and propagate the desired register back through Select0.

Noticed when fixing #51964

Change-Id: I83346b988882cd58c2d7e7e5b419a2b9a244ab66
Reviewed-on: https://go-review.googlesource.com/c/go/+/396035
Trust: Keith Randall <8c99c3a9284e493be632950b84cd789d08ed3e9d@golang.org>
Run-TryBot: Keith Randall <8c99c3a9284e493be632950b84cd789d08ed3e9d@golang.org>
Reviewed-by: David Chase <ae171625adc8645b8b79b7e405a6da5aba5341e0@google.com>
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

nawawi/go,CAFxX/go,golang/go,CAFxX/go,CAFxX/go,CAFxX/go,nawawi/go,golang/go,nawawi/go,nawawi/go,nawawi/go,CAFxX/go,CAFxX/go,golang/go,golang/go,nawawi/go,golang/go,golang/go,CAFxX/go,nawawi/go,nawawi/go,golang/go,golang/go,CAFxX/go