mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/ssa: refactor zeroUpper32Bits
Explicitly whitelist args of OpSelect{1|2} that zero upper 32 bits.
Use better values in corresponding test.
This should have been a part of CL 96815, but it was submitted, before
relevant comments.
Change-Id: Ic85d90a4471a17f6d64f8f5c405f21378bf3a30d
Reviewed-on: https://go-review.googlesource.com/97295
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
ccaa2bc5c0
commit
c2ccc48165
2 changed files with 7 additions and 7 deletions
|
|
@ -804,9 +804,9 @@ 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 OpPhi:
|
||||
case OpPhi, OpSelect0, OpSelect1:
|
||||
// Phis can use each-other as an arguments, instead of tracking visited values,
|
||||
// just limit recursion depth.
|
||||
if depth <= 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue