]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.8] cmd/compile: fix merging of s390x conditional moves into branc...
authorMichael Munday <munday@ca.ibm.com>
Tue, 21 Feb 2017 20:20:38 +0000 (15:20 -0500)
committerMichael Munday <munday@ca.ibm.com>
Thu, 2 Mar 2017 04:26:19 +0000 (04:26 +0000)
commit6a712dfac19f2117fd54c7af2280c67be07727ac
treea6c7fb285c18395bad29b988c7104b6624b19119
parent865536b1977d57d398e3bffaba9f205f1172a262
[release-branch.go1.8] cmd/compile: fix merging of s390x conditional moves into branch conditions

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: I44958eebf6c74c5819b2a9511caf3c47c20fbf45
Reviewed-on: https://go-review.googlesource.com/37536
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssa/export_test.go
src/cmd/compile/internal/ssa/gen/S390X.rules
src/cmd/compile/internal/ssa/loop_test.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/rewriteS390X.go