New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: s390x cannot merge conditional bool load into comparison #19227
Labels
Comments
CL https://golang.org/cl/37334 mentions this issue. |
CL https://golang.org/cl/37578 mentions this issue. |
CL https://golang.org/cl/37577 mentions this issue. |
CL https://golang.org/cl/37534 mentions this issue. |
CL https://golang.org/cl/37536 mentions this issue. |
CL https://golang.org/cl/37535 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
Mar 2, 2017
…ns on s390x Some rules insert MOVDreg ops to ensure that type changes are kept. If there is no type change (or the input is constant) then the MOVDreg can be omitted, allowing further optimization. Reduces the size of the .text section in the asm tool by ~33KB. For #19227. Change-Id: I0f7b40d8dbcda73bca96eb6d2bf13f9ffa88f4b6 Reviewed-on: https://go-review.googlesource.com/37535 Run-TryBot: Michael Munday <munday@ca.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
gopherbot
pushed a commit
that referenced
this issue
Mar 2, 2017
…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>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?go version go1.8 linux/s390x
What did you do?
$ cat loop.go
$ GOSSAFUNC=main go run loop.go
What did you expect to see?
One comparison, like 1.8rc3:
What did you see instead?
Conditional move not optimized away:
This regression was caused by CL 36350 (758a728) and significantly reduces the performance of small loops. I have a fix for tip, backporting the fix to 1.8.1 will also require merging CL 36547.
The text was updated successfully, but these errors were encountered: