diff options
author | David Chase <drchase@google.com> | 2021-04-21 10:55:42 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2021-05-08 17:03:18 +0000 |
commit | b38b1b2f9ae710ee2c16a103bb21644f1adbc5d3 (patch) | |
tree | 49395dd78b327b3f7e4d22d3c0229763de12ca39 /src/cmd/compile/internal/ssa/export_test.go | |
parent | 68327e1aa11457cd570bc7eaf03a0260950f27d9 (diff) | |
download | go-b38b1b2f9ae710ee2c16a103bb21644f1adbc5d3.tar.gz go-b38b1b2f9ae710ee2c16a103bb21644f1adbc5d3.zip |
cmd/compile: manage Slot array better
steals idea from CL 312093
further investigation revealed additional duplicate
slots (equivalent, but not equal), so delete those too.
Rearranged Func.Names to be addresses of slots,
create canonical addresses so that split slots
(which use those addresses to refer to their parent,
and split slots can be further split)
will preserve "equivalent slots are equal".
Removes duplicates, improves metrics for "args at entry".
Change-Id: I5bbdcb50bd33655abcab3d27ad8cdce25499faaf
Reviewed-on: https://go-review.googlesource.com/c/go/+/312292
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/export_test.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index 32e6d09d1b..8ed8a0c4a6 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -73,36 +73,6 @@ func (TestFrontend) Auto(pos src.XPos, t *types.Type) *ir.Name { n.Class = ir.PAUTO return n } -func (d TestFrontend) SplitString(s LocalSlot) (LocalSlot, LocalSlot) { - return LocalSlot{N: s.N, Type: testTypes.BytePtr, Off: s.Off}, LocalSlot{N: s.N, Type: testTypes.Int, Off: s.Off + 8} -} -func (d TestFrontend) SplitInterface(s LocalSlot) (LocalSlot, LocalSlot) { - return LocalSlot{N: s.N, Type: testTypes.BytePtr, Off: s.Off}, LocalSlot{N: s.N, Type: testTypes.BytePtr, Off: s.Off + 8} -} -func (d TestFrontend) SplitSlice(s LocalSlot) (LocalSlot, LocalSlot, LocalSlot) { - return LocalSlot{N: s.N, Type: s.Type.Elem().PtrTo(), Off: s.Off}, - LocalSlot{N: s.N, Type: testTypes.Int, Off: s.Off + 8}, - LocalSlot{N: s.N, Type: testTypes.Int, Off: s.Off + 16} -} -func (d TestFrontend) SplitComplex(s LocalSlot) (LocalSlot, LocalSlot) { - if s.Type.Size() == 16 { - return LocalSlot{N: s.N, Type: testTypes.Float64, Off: s.Off}, LocalSlot{N: s.N, Type: testTypes.Float64, Off: s.Off + 8} - } - return LocalSlot{N: s.N, Type: testTypes.Float32, Off: s.Off}, LocalSlot{N: s.N, Type: testTypes.Float32, Off: s.Off + 4} -} -func (d TestFrontend) SplitInt64(s LocalSlot) (LocalSlot, LocalSlot) { - if s.Type.IsSigned() { - return LocalSlot{N: s.N, Type: testTypes.Int32, Off: s.Off + 4}, LocalSlot{N: s.N, Type: testTypes.UInt32, Off: s.Off} - } - return LocalSlot{N: s.N, Type: testTypes.UInt32, Off: s.Off + 4}, LocalSlot{N: s.N, Type: testTypes.UInt32, Off: s.Off} -} -func (d TestFrontend) SplitStruct(s LocalSlot, i int) LocalSlot { - return LocalSlot{N: s.N, Type: s.Type.FieldType(i), Off: s.Off + s.Type.FieldOff(i)} -} -func (d TestFrontend) SplitArray(s LocalSlot) LocalSlot { - return LocalSlot{N: s.N, Type: s.Type.Elem(), Off: s.Off} -} - func (d TestFrontend) SplitSlot(parent *LocalSlot, suffix string, offset int64, t *types.Type) LocalSlot { return LocalSlot{N: parent.N, Type: t, Off: offset} } |