cmd/compile: use bool->uint8 op instead of copy

Just a cleanup to make sure that generic SSA is properly typed.

Change-Id: Ie75fa972ae4e5fdaca535968769bca36044191c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/372574
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Keith Randall 2021-12-15 15:59:43 -08:00
parent 510ad4561f
commit 620a3c0596

View file

@ -2382,7 +2382,7 @@ func (s *state) ssaShiftOp(op ir.Op, t *types.Type, u *types.Type) ssa.Op {
func (s *state) conv(n ir.Node, v *ssa.Value, ft, tt *types.Type) *ssa.Value {
if ft.IsBoolean() && tt.IsKind(types.TUINT8) {
// Bool -> uint8 is generated internally when indexing into runtime.staticbyte.
return s.newValue1(ssa.OpCopy, tt, v)
return s.newValue1(ssa.OpCvtBoolToUint8, tt, v)
}
if ft.IsInteger() && tt.IsInteger() {
var op ssa.Op