]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: add decompose pass
authorKeith Randall <khr@golang.org>
Tue, 18 Aug 2015 17:26:28 +0000 (10:26 -0700)
committerKeith Randall <khr@golang.org>
Thu, 20 Aug 2015 21:09:24 +0000 (21:09 +0000)
commit9f954db170dff18a33fbd333082cd8758851f936
treea3badf054d0560d26e3b6e096a7d8a7f353eafed
parent8d23681cc836db6ed233564781747592f1c41225
[dev.ssa] cmd/compile: add decompose pass

Decompose breaks compound objects up into pieces that can be
operated on by the target architecture.  The decompose pass only
does phi ops, the rest is done by the rewrite rules in generic.rules.

Compound objects include strings,slices,interfaces,structs,arrays.

Arrays aren't decomposed because of indexing (we could support
constant indexes, but dynamic indexes can't be handled using SSA).
Structs will come in a subsequent CL.

TODO: after this pass we have lost the association between, e.g.,
a string's pointer and its size.  It would be nice if we could keep
that information around for debugging info somehow.

Change-Id: I6379ab962a7beef62297d0f68c421f22aa0a0901
Reviewed-on: https://go-review.googlesource.com/13683
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/testdata/compound_ssa.go [new file with mode: 0644]
src/cmd/compile/internal/gc/type.go
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/decompose.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewritegeneric.go
src/cmd/compile/internal/ssa/type.go
src/cmd/compile/internal/ssa/type_test.go