• Josh Bleecher Snyder's avatar
    [dev.ssa] cmd/compile/ssa: refine type equality in cse · d9a704cd
    Josh Bleecher Snyder authored
    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/11451Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    d9a704cd
TODO 2.47 KB