]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: move tuple selectors to generator's block in CSE
authorCherry Zhang <cherryyz@google.com>
Tue, 14 Jun 2016 15:18:39 +0000 (11:18 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 24 Jun 2016 17:33:39 +0000 (17:33 +0000)
commit8eadb89266a5a785e568f936b176d746a6d7de7c
tree113efa51d299e04bd131729c2ac95263bf23caae
parent8086ce44c4ddaba03fe0edb62aed8ca723cf0cfe
[dev.ssa] cmd/compile: move tuple selectors to generator's block in CSE

CSE may substitute a tuple generator with another one in a different
block. In this case, since we want tuple selectors to stay together
with the tuple generator, copy the selector to the new generator's
block and rewrite its use.

Op.isTupleGenerator and Op.isTupleSelector are introduced to assert
tuple ops. Use it in tighten as well.

Updates #15365.

Change-Id: Ia9e8c734b9cc3bc9fca4a2750041eef9cdfac5a5
Reviewed-on: https://go-review.googlesource.com/24137
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/cse.go
src/cmd/compile/internal/ssa/op.go
src/cmd/compile/internal/ssa/tighten.go