[dev.typeparams] cmd/compile: do not schedule in-register args late, even for block control
[dev.typeparams] cmd/compile: do not schedule in-register args late, even for block control

In the scheduler we have the logic that if a Value is used as the
block's control, we schedule it at the end, except for Phis and
Args. Even the comment says so, the code doesn't exclude
in-register Args (OpArgXXXReg).

Change to check for score instead, which includes OpArgXXXRegs.
It also includes GetClosurePtr, which must be scheduled early.
We just happen to never use it as block control.

Found when working on ARM64 register ABI. In theory this could
apply to AMD64 as well. But on AMD64 we never use in-register
Value as block control, as conditional branch is always based on
FLAGS, never based on registers, so it doesn't actually cause any
problem.

Change-Id: I167a550309772639574f7468caf91bd805eb74c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/322849
Trust: Cherry Mui <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
Run-TryBot: Cherry Mui <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Than McIntosh <4b2922593166fc595a9b1a408f34f5d3817fe9d2@google.com>
Reviewed-by: David Chase <ae171625adc8645b8b79b7e405a6da5aba5341e0@google.com>

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