]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use bool->uint8 op instead of copy
authorKeith Randall <khr@golang.org>
Wed, 15 Dec 2021 23:59:43 +0000 (15:59 -0800)
committerKeith Randall <khr@golang.org>
Tue, 1 Mar 2022 18:48:36 +0000 (18:48 +0000)
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>
src/cmd/compile/internal/ssagen/ssa.go

index 364e0c8197ebf6859b51cc865667959986ccf71a..60747d93ca9c15548d05fc4f016c8192fa5d52a6 100644 (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