diff options
| author | Cherry Zhang <cherryyz@google.com> | 2018-01-02 15:20:19 -0500 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2018-01-02 21:08:35 +0000 |
| commit | 7f1c4b3afbc809afff6813eade571e3c3a4c0e15 (patch) | |
| tree | 68d68c8dfab56255cce30b2d9185639e8127efa7 /src | |
| parent | 2ba3fd484bb048be86c2bd804900151a1ec5affd (diff) | |
| download | go-7f1c4b3afbc809afff6813eade571e3c3a4c0e15.tar.xz | |
cmd/compile: disable "redundant zeroextensions" optimization for Select on AMD64
A Select Op could produce a value with upper 32 bits NOT zeroed,
for example, Div32 is lowered to (Select0 (DIVL x y)).
In theory, we could look into the argument of a Select to decide
whether the upper bits are zeroed. As it is late in release cycle,
just disable this optimization for Select for now.
Fixes #23305.
Change-Id: Icf665a2af9ccb0a7ba0ae00c683c9e349638bf85
Reviewed-on: https://go-review.googlesource.com/85736
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/ssa/rewrite.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index 4e8eb4d3b6..c617841ee8 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -646,8 +646,12 @@ func zeroUpper32Bits(x *Value, depth int) bool { OpAMD64ANDL, OpAMD64ANDLconst, OpAMD64ORL, OpAMD64ORLconst, OpAMD64XORL, OpAMD64XORLconst, OpAMD64NEGL, OpAMD64NOTL: return true - case OpArg, OpSelect0, OpSelect1: + case OpArg: return x.Type.Width == 4 + case OpSelect0, OpSelect1: + // Disabled for now. See issue 23305. + // TODO: we could look into the arg of the Select to decide. + return false case OpPhi: // Phis can use each-other as an arguments, instead of tracking visited values, // just limit recursion depth. |
