]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/abi: use Type.Registers
authorMatthew Dempsky <mdempsky@google.com>
Tue, 12 Sep 2023 04:13:10 +0000 (21:13 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 13 Sep 2023 18:34:00 +0000 (18:34 +0000)
commitc0e2a9dffdb6af116ec5184a680cb3b4e904d0fa
tree72686b92289cb27e932b9260772441053aac68f7
parentc80a9f172bbab2b19fa3680c7928fcedf3088e4d
cmd/compile/internal/abi: use Type.Registers

Now that types can self-report how many registers they need, it's much
easier to determine whether a parameter will fit into the available
registers: simply compare the number of registers needed against the
number of registers still available.

This also eliminates the need for the NumParamRegs cache.

Also, the new code in NumParamRegs is stricter in only allowing it to
be called on types that can actually be passed in registers, which
requires a test to be corrected for that. While here, change mkstruct
to a variadic function, so the call sites require less boilerplate.

Change-Id: Iebe1a0456a8053a10e551e5da796014e5b1b695b
Reviewed-on: https://go-review.googlesource.com/c/go/+/527339
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/cmd/compile/internal/abi/abiutils.go
src/cmd/compile/internal/test/abiutils_test.go
src/cmd/compile/internal/test/abiutilsaux_test.go