[dev.ssa] cmd/compile/internal/ssa: handle rewrite of Phis.

* Phis can have variable number of arguments, but rulegen assumed that
each operation has fixed number of arguments.
* Rewriting Phis is necessary to handle the following case:

func f1_ssa(a bool, x int) int {
        v := 0
        if a {
                v = -1
        } else {
                v = -1
        }
        return x|v
}

Change-Id: Iff6bd411b854f3d1d6d3ce21934bf566757094f2
Reviewed-on: https://go-review.googlesource.com/19412
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Alexandru Moșoi 2016-02-09 19:46:26 +01:00 committed by Alexandru Moșoi
parent 7f7f7cddec
commit d0d04d2d6c
6 changed files with 140 additions and 2 deletions

View file

@ -32,6 +32,7 @@ type opData struct {
typ string // default result type
aux string
rematerializeable bool
variableLength bool // if true the operation has a variable number of arguments
}
type blockData struct {