• Keith Randall's avatar
    [dev.ssa] cmd/compile: add decompose pass · 9f954db1
    Keith Randall authored
    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/13683Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
    9f954db1
genericOps.go 10.1 KB