]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: generalize struct load/store
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 5 Sep 2024 07:56:43 +0000 (14:56 +0700)
committerGopher Robot <gobot@golang.org>
Thu, 26 Sep 2024 13:18:08 +0000 (13:18 +0000)
commit6d856a804c5d9cfc72104b0e7578da5b38509909
tree647e7cbdc50656a4e30a129596bb0fa9ca6d0441
parenta3a05ed04cb53c53bdacded2d16f0f3e5facdbb0
cmd/compile: generalize struct load/store

The SSA backend currently only handle struct with up to 4 fields. Thus,
there are different operations corresponding to number fields of the
struct.

This CL generalizes these with just one OpStructMake, allow struct types
with arbitrary number of fields.

However, the ssa.MaxStruct is still kept as-is, and future CL will
increase this value to optimize large structs.

Updates #24416

Change-Id: I192ffbea881186693584476b5639394e79be45c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/611075
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
12 files changed:
src/cmd/compile/internal/ssa/_gen/dec.rules
src/cmd/compile/internal/ssa/_gen/generic.rules
src/cmd/compile/internal/ssa/_gen/genericOps.go
src/cmd/compile/internal/ssa/copyelim.go
src/cmd/compile/internal/ssa/decompose.go
src/cmd/compile/internal/ssa/expand_calls.go
src/cmd/compile/internal/ssa/numberlines.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewritedec.go
src/cmd/compile/internal/ssa/rewritegeneric.go
src/cmd/compile/internal/ssagen/ssa.go