]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile/ssa: refine type equality in cse
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 24 Jun 2015 21:34:28 +0000 (14:34 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 29 Jun 2015 03:27:30 +0000 (03:27 +0000)
commitd9a704cd40e8d248b473a831f099d8d4ca4c409b
tree7e3e276848754b588077edfd7df67336da231ab6
parentdbd83c4464ed37b350deae313eddf7babc3e4c41
[dev.ssa] cmd/compile/ssa: refine type equality in cse

The correct way to compare gc.Types is Eqtype,
rather than pointer equality.
Introduce an Equal method for ssa.Type to allow
us to use it.

In the cse pass, use a type's string to build
the coarse partition, and then use Type.Equal
during refinement.

This lets the cse pass do a better job.
In the ~20% of the standard library that SSA
can compile, the number of common subexpressions
recognized by the cse pass increases from
27,550 to 32,199 (+17%). The number of nil checks
eliminated increases from 75 to 115 (+50%).

Change-Id: I0bdbfcf613ca6bc2ec987eb19b6b1217b51f3008
Reviewed-on: https://go-review.googlesource.com/11451
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/type.go
src/cmd/compile/internal/ssa/TODO
src/cmd/compile/internal/ssa/cse.go
src/cmd/compile/internal/ssa/type.go