]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix type propagation through s390x SSA rules
authorMichael Munday <munday@ca.ibm.com>
Fri, 3 Feb 2017 09:55:34 +0000 (04:55 -0500)
committerMichael Munday <munday@ca.ibm.com>
Fri, 3 Feb 2017 21:27:21 +0000 (21:27 +0000)
commitddf807fce821c26da32f653a2483bb7d96b20e26
tree672a187b08f96947810ec185f33279c2d7394185
parent178307c3a72a9da3d731fecf354630761d6b246c
cmd/compile: fix type propagation through s390x SSA rules

This CL fixes two issues:

1. Load ops were initially always lowered to unsigned loads, even
   for signed types. This was fine by itself however LoadReg ops
   (used to re-load spilled values) were lowered to signed loads
   for signed types. This meant that spills could invalidate
   optimizations that assumed the original unsigned load.

2. Types were not always being maintained correctly through rules
   designed to eliminate unnecessary zero and sign extensions.

Fixes #18906.

Change-Id: I95785dcadba03f7e3e94524677e7d8d3d3b9b737
Reviewed-on: https://go-review.googlesource.com/36256
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/s390x/ssa.go
src/cmd/compile/internal/ssa/gen/S390X.rules
src/cmd/compile/internal/ssa/gen/S390XOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteS390X.go
test/fixedbugs/issue18906.go [new file with mode: 0644]