• Michael Munday's avatar
    cmd/compile: fix merging of s390x conditional moves into branch conditions · 4dbcb53d
    Michael Munday authored
    A type conversion inserted between MOVD{LT,LE,GT,GE,EQ,NE} and CMPWconst
    by CL 36256 broke the rewrite rule designed to merge the two.
    This results in simple for loops (e.g. for i := 0; i < N; i++ {})
    emitting two comparisons instead of one, plus a conditional move.
    
    This CL explicitly types the input to CMPWconst so that the type conversion
    can be omitted. It also adds a test to check that conditional moves aren't
    emitted for loops with 'less than' conditions (i.e. i < N) on s390x.
    
    Fixes #19227.
    
    Change-Id: Ia39e806ed723791c3c755951aef23f957828ea3e
    Reviewed-on: https://go-review.googlesource.com/37334Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    4dbcb53d
export_test.go 4.05 KB