aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2019-10-04 16:55:52 -0400
committerCherry Zhang <cherryyz@google.com>2019-10-04 16:55:52 -0400
commitb0d930577ebe86d0dbd6d3f4bf551a4e4ff1fcde (patch)
treec1382943d8874ef6f278b1b49d38b4a5090993a8 /src/cmd
parente63c1df34856fbf61f72fef84f810cf3306ec204 (diff)
parentc450ace12c657e3953d79975c04f51605395cd50 (diff)
downloadgo-b0d930577ebe86d0dbd6d3f4bf551a4e4ff1fcde.tar.xz
[dev.link] all: merge branch 'master' into dev.link
Weekly merge. Change-Id: I98c6121f04f347df2788ac5eaf99afad5da4a039
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/asm/internal/asm/testdata/arm64.s12
-rw-r--r--src/cmd/cgo/gcc.go6
-rw-r--r--src/cmd/cgo/out.go12
-rw-r--r--src/cmd/compile/internal/amd64/ssa.go6
-rw-r--r--src/cmd/compile/internal/arm/ssa.go2
-rw-r--r--src/cmd/compile/internal/arm64/ssa.go8
-rw-r--r--src/cmd/compile/internal/gc/escape.go10
-rw-r--r--src/cmd/compile/internal/gc/export.go2
-rw-r--r--src/cmd/compile/internal/gc/fmt.go2
-rw-r--r--src/cmd/compile/internal/gc/iexport.go65
-rw-r--r--src/cmd/compile/internal/gc/iimport.go25
-rw-r--r--src/cmd/compile/internal/gc/initorder.go2
-rw-r--r--src/cmd/compile/internal/gc/inl.go27
-rw-r--r--src/cmd/compile/internal/gc/inl_test.go4
-rw-r--r--src/cmd/compile/internal/gc/noder.go8
-rw-r--r--src/cmd/compile/internal/gc/order.go38
-rw-r--r--src/cmd/compile/internal/gc/plive.go2
-rw-r--r--src/cmd/compile/internal/gc/range.go2
-rw-r--r--src/cmd/compile/internal/gc/select.go4
-rw-r--r--src/cmd/compile/internal/gc/sinit.go3
-rw-r--r--src/cmd/compile/internal/gc/ssa.go22
-rw-r--r--src/cmd/compile/internal/gc/subr.go12
-rw-r--r--src/cmd/compile/internal/gc/swt.go14
-rw-r--r--src/cmd/compile/internal/gc/syntax.go8
-rw-r--r--src/cmd/compile/internal/gc/typecheck.go9
-rw-r--r--src/cmd/compile/internal/gc/walk.go38
-rw-r--r--src/cmd/compile/internal/gc/zerorange_test.go98
-rw-r--r--src/cmd/compile/internal/mips/ssa.go6
-rw-r--r--src/cmd/compile/internal/mips64/ssa.go6
-rw-r--r--src/cmd/compile/internal/ppc64/ssa.go2
-rw-r--r--src/cmd/compile/internal/s390x/ssa.go7
-rw-r--r--src/cmd/compile/internal/ssa/README.md8
-rw-r--r--src/cmd/compile/internal/ssa/block.go104
-rw-r--r--src/cmd/compile/internal/ssa/branchelim.go106
-rw-r--r--src/cmd/compile/internal/ssa/check.go52
-rw-r--r--src/cmd/compile/internal/ssa/compile.go1
-rw-r--r--src/cmd/compile/internal/ssa/copyelim.go6
-rw-r--r--src/cmd/compile/internal/ssa/cse.go4
-rw-r--r--src/cmd/compile/internal/ssa/deadcode.go14
-rw-r--r--src/cmd/compile/internal/ssa/deadstore.go11
-rw-r--r--src/cmd/compile/internal/ssa/flagalloc.go42
-rw-r--r--src/cmd/compile/internal/ssa/fuse.go2
-rw-r--r--src/cmd/compile/internal/ssa/gen/386.rules100
-rw-r--r--src/cmd/compile/internal/ssa/gen/386Ops.go32
-rw-r--r--src/cmd/compile/internal/ssa/gen/AMD64.rules20
-rw-r--r--src/cmd/compile/internal/ssa/gen/AMD64Ops.go32
-rw-r--r--src/cmd/compile/internal/ssa/gen/ARM.rules100
-rw-r--r--src/cmd/compile/internal/ssa/gen/ARM64.rules116
-rw-r--r--src/cmd/compile/internal/ssa/gen/ARM64Ops.go40
-rw-r--r--src/cmd/compile/internal/ssa/gen/ARMOps.go20
-rw-r--r--src/cmd/compile/internal/ssa/gen/MIPS.rules24
-rw-r--r--src/cmd/compile/internal/ssa/gen/MIPS64.rules24
-rw-r--r--src/cmd/compile/internal/ssa/gen/MIPS64Ops.go16
-rw-r--r--src/cmd/compile/internal/ssa/gen/MIPSOps.go16
-rw-r--r--src/cmd/compile/internal/ssa/gen/PPC64.rules36
-rw-r--r--src/cmd/compile/internal/ssa/gen/PPC64Ops.go20
-rw-r--r--src/cmd/compile/internal/ssa/gen/S390X.rules16
-rw-r--r--src/cmd/compile/internal/ssa/gen/S390XOps.go2
-rw-r--r--src/cmd/compile/internal/ssa/gen/generic.rules4
-rw-r--r--src/cmd/compile/internal/ssa/gen/genericOps.go28
-rw-r--r--src/cmd/compile/internal/ssa/gen/main.go3
-rw-r--r--src/cmd/compile/internal/ssa/gen/rulegen.go129
-rw-r--r--src/cmd/compile/internal/ssa/html.go4
-rw-r--r--src/cmd/compile/internal/ssa/loopbce.go9
-rw-r--r--src/cmd/compile/internal/ssa/nilcheck.go15
-rw-r--r--src/cmd/compile/internal/ssa/nilcheck_test.go2
-rw-r--r--src/cmd/compile/internal/ssa/numberlines.go45
-rw-r--r--src/cmd/compile/internal/ssa/phiopt.go8
-rw-r--r--src/cmd/compile/internal/ssa/prove.go26
-rw-r--r--src/cmd/compile/internal/ssa/regalloc.go47
-rw-r--r--src/cmd/compile/internal/ssa/rewrite.go7
-rw-r--r--src/cmd/compile/internal/ssa/rewrite386.go1048
-rw-r--r--src/cmd/compile/internal/ssa/rewriteAMD64.go1644
-rw-r--r--src/cmd/compile/internal/ssa/rewriteARM.go3080
-rw-r--r--src/cmd/compile/internal/ssa/rewriteARM64.go1954
-rw-r--r--src/cmd/compile/internal/ssa/rewriteMIPS.go338
-rw-r--r--src/cmd/compile/internal/ssa/rewriteMIPS64.go322
-rw-r--r--src/cmd/compile/internal/ssa/rewritePPC64.go888
-rw-r--r--src/cmd/compile/internal/ssa/rewriteS390X.go121
-rw-r--r--src/cmd/compile/internal/ssa/rewritegeneric.go27
-rw-r--r--src/cmd/compile/internal/ssa/schedule.go18
-rw-r--r--src/cmd/compile/internal/ssa/shortcircuit.go4
-rw-r--r--src/cmd/compile/internal/ssa/sizeof_test.go2
-rw-r--r--src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts8
-rw-r--r--src/cmd/compile/internal/ssa/testdata/hist.gdb-dbg.nexts2
-rw-r--r--src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts44
-rw-r--r--src/cmd/compile/internal/ssa/tighten.go2
-rw-r--r--src/cmd/compile/internal/ssa/trim.go23
-rw-r--r--src/cmd/compile/internal/ssa/value.go10
-rw-r--r--src/cmd/compile/internal/ssa/writebarrier.go2
-rw-r--r--src/cmd/compile/internal/wasm/ssa.go6
-rw-r--r--src/cmd/compile/internal/x86/ssa.go6
-rw-r--r--src/cmd/go.mod2
-rw-r--r--src/cmd/go.sum8
-rw-r--r--src/cmd/go/alldocs.go1
-rw-r--r--src/cmd/go/internal/clean/clean.go2
-rw-r--r--src/cmd/go/internal/generate/generate.go2
-rw-r--r--src/cmd/go/internal/get/get.go2
-rw-r--r--src/cmd/go/internal/get/path.go3
-rw-r--r--src/cmd/go/internal/list/list.go2
-rw-r--r--src/cmd/go/internal/load/pkg.go59
-rw-r--r--src/cmd/go/internal/load/pkg_test.go44
-rw-r--r--src/cmd/go/internal/modcmd/download.go30
-rw-r--r--src/cmd/go/internal/modfetch/coderepo_test.go8
-rw-r--r--src/cmd/go/internal/modfile/read_test.go23
-rw-r--r--src/cmd/go/internal/modfile/rule.go2
-rw-r--r--src/cmd/go/internal/modget/get.go21
-rw-r--r--src/cmd/go/internal/module/module.go3
-rw-r--r--src/cmd/go/internal/module/module_test.go3
-rw-r--r--src/cmd/go/internal/run/run.go2
-rw-r--r--src/cmd/go/internal/test/test.go2
-rw-r--r--src/cmd/go/internal/test/testflag.go2
-rw-r--r--src/cmd/go/internal/vet/vetflag.go2
-rw-r--r--src/cmd/go/internal/work/build.go24
-rw-r--r--src/cmd/go/testdata/script/build_multi_main.txt10
-rw-r--r--src/cmd/go/testdata/script/list_ambiguous_path.txt37
-rw-r--r--src/cmd/go/testdata/script/mod_download.txt4
-rw-r--r--src/cmd/go/testdata/script/mod_download_latest.txt20
-rw-r--r--src/cmd/go/testdata/script/mod_get_trailing_slash.txt14
-rw-r--r--src/cmd/go/testdata/script/mod_getmode_vendor.txt2
-rw-r--r--src/cmd/go/testdata/script/mod_list_upgrade.txt20
-rw-r--r--src/cmd/internal/obj/arm64/a.out.go4
-rw-r--r--src/cmd/internal/obj/arm64/anames.go4
-rw-r--r--src/cmd/internal/obj/arm64/asm7.go52
-rw-r--r--src/cmd/internal/obj/ppc64/obj9.go62
-rw-r--r--src/cmd/internal/src/pos.go5
-rw-r--r--src/cmd/internal/src/xpos.go5
-rw-r--r--src/cmd/link/internal/ld/outbuf_nommap.go2
-rw-r--r--src/cmd/link/internal/ld/outbuf_windows.go49
-rw-r--r--src/cmd/link/internal/wasm/asm.go30
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go21
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/diagnostic.go48
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go16
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go6
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/internal/facts/facts.go22
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go10
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go4
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/whitelist.go1
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ctrlflow/ctrlflow.go9
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/errorsas/errorsas.go2
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go76
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go8
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go6
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go8
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go2
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go2
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go2
-rw-r--r--src/cmd/vendor/modules.txt2
148 files changed, 7036 insertions, 5078 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/arm64.s b/src/cmd/asm/internal/asm/testdata/arm64.s
index 9f19ff1e8d..93f70045b7 100644
--- a/src/cmd/asm/internal/asm/testdata/arm64.s
+++ b/src/cmd/asm/internal/asm/testdata/arm64.s
@@ -352,6 +352,18 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
VLD4 (R15), [V10.H4, V11.H4, V12.H4, V13.H4] // ea05400c
VLD4.P 32(R24), [V31.B8, V0.B8, V1.B8, V2.B8] // 1f03df0c
VLD4.P (R13)(R9), [V14.S2, V15.S2, V16.S2, V17.S2] // VLD4.P (R13)(R9*1), [V14.S2,V15.S2,V16.S2,V17.S2] // ae09c90c
+ VLD1R (R0), [V0.B16] // 00c0404d
+ VLD1R.P 16(R0), [V0.B16] // 00c0df4d
+ VLD1R.P (R15)(R1), [V15.H4] // VLD1R.P (R15)(R1*1), [V15.H4] // efc5c10d
+ VLD2R (R15), [V15.H4, V16.H4] // efc5600d
+ VLD2R.P 32(R0), [V0.D2, V1.D2] // 00ccff4d
+ VLD2R.P (R0)(R5), [V31.D1, V0.D1] // VLD2R.P (R0)(R5*1), [V31.D1, V0.D1] // 1fcce50d
+ VLD3R (RSP), [V31.S2, V0.S2, V1.S2] // ffeb400d
+ VLD3R.P 24(R15), [V15.H4, V16.H4, V17.H4] // efe5df0d
+ VLD3R.P (R15)(R6), [V15.H8, V16.H8, V17.H8] // VLD3R.P (R15)(R6*1), [V15.H8, V16.H8, V17.H8] // efe5c64d
+ VLD4R (R0), [V0.B8, V1.B8, V2.B8, V3.B8] // 00e0600d
+ VLD4R.P 64(RSP), [V31.S4, V0.S4, V1.S4, V2.S4] // ffebff4d
+ VLD4R.P (R15)(R9), [V15.H4, V16.H4, V17.H4, V18.H4] // VLD4R.P (R15)(R9*1), [V15.H4, V16.H4, V17.H4, V18.H4] // efe5e90d
VST1.P [V24.S2], 8(R2) // 58789f0c
VST1 [V29.S2, V30.S2], (R29) // bdab000c
VST1 [V14.H4, V15.H4, V16.H4], (R27) // 6e67000c
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
index 01b86adadb..12d4749677 100644
--- a/src/cmd/cgo/gcc.go
+++ b/src/cmd/cgo/gcc.go
@@ -816,7 +816,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
// Rewrite C.f(p) to
// func() {
// _cgo0 := p
- // _cgoCheckPointer(_cgo0)
+ // _cgoCheckPointer(_cgo0, nil)
// C.f(_cgo0)
// }()
// Using a function literal like this lets us evaluate the
@@ -834,7 +834,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
// defer func() func() {
// _cgo0 := p
// return func() {
- // _cgoCheckPointer(_cgo0)
+ // _cgoCheckPointer(_cgo0, nil)
// C.f(_cgo0)
// }
// }()()
@@ -921,7 +921,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) {
}
fmt.Fprintf(&sb, "_cgo%d := %s; ", i, gofmtPos(arg, origArg.Pos()))
- fmt.Fprintf(&sbCheck, "_cgoCheckPointer(_cgo%d); ", i)
+ fmt.Fprintf(&sbCheck, "_cgoCheckPointer(_cgo%d, nil); ", i)
}
if call.Deferred {
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
index 1fddbb6b54..6bee9b1909 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -1631,14 +1631,14 @@ func _cgo_runtime_cgocall(unsafe.Pointer, uintptr) int32
func _cgo_runtime_cgocallback(unsafe.Pointer, unsafe.Pointer, uintptr, uintptr)
//go:linkname _cgoCheckPointer runtime.cgoCheckPointer
-func _cgoCheckPointer(interface{}, ...interface{})
+func _cgoCheckPointer(interface{}, interface{})
//go:linkname _cgoCheckResult runtime.cgoCheckResult
func _cgoCheckResult(interface{})
`
const gccgoGoProlog = `
-func _cgoCheckPointer(interface{}, ...interface{})
+func _cgoCheckPointer(interface{}, interface{})
func _cgoCheckResult(interface{})
`
@@ -1825,16 +1825,16 @@ typedef struct __go_empty_interface {
void *__object;
} Eface;
-extern void runtimeCgoCheckPointer(Eface, Slice)
+extern void runtimeCgoCheckPointer(Eface, Eface)
__asm__("runtime.cgoCheckPointer")
__attribute__((weak));
-extern void localCgoCheckPointer(Eface, Slice)
+extern void localCgoCheckPointer(Eface, Eface)
__asm__("GCCGOSYMBOLPREF._cgoCheckPointer");
-void localCgoCheckPointer(Eface ptr, Slice args) {
+void localCgoCheckPointer(Eface ptr, Eface arg) {
if(runtimeCgoCheckPointer) {
- runtimeCgoCheckPointer(ptr, args);
+ runtimeCgoCheckPointer(ptr, arg);
}
}
diff --git a/src/cmd/compile/internal/amd64/ssa.go b/src/cmd/compile/internal/amd64/ssa.go
index 9c91e05661..b52b996407 100644
--- a/src/cmd/compile/internal/amd64/ssa.go
+++ b/src/cmd/compile/internal/amd64/ssa.go
@@ -18,8 +18,8 @@ import (
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
func ssaMarkMoves(s *gc.SSAGenState, b *ssa.Block) {
flive := b.FlagsLiveAtEnd
- if b.Control != nil && b.Control.Type.IsFlags() {
- flive = true
+ for _, c := range b.ControlValues() {
+ flive = c.Type.IsFlags() || flive
}
for i := len(b.Values) - 1; i >= 0; i-- {
v := b.Values[i]
@@ -1245,6 +1245,6 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
}
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/compile/internal/arm/ssa.go b/src/cmd/compile/internal/arm/ssa.go
index ab0f417117..2c77912f21 100644
--- a/src/cmd/compile/internal/arm/ssa.go
+++ b/src/cmd/compile/internal/arm/ssa.go
@@ -955,6 +955,6 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
}
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/compile/internal/arm64/ssa.go b/src/cmd/compile/internal/arm64/ssa.go
index f13bd71f7a..252e875669 100644
--- a/src/cmd/compile/internal/arm64/ssa.go
+++ b/src/cmd/compile/internal/arm64/ssa.go
@@ -1057,9 +1057,9 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
s.Br(obj.AJMP, b.Succs[0].Block())
}
}
- if !b.Control.Type.IsFlags() {
+ if !b.Controls[0].Type.IsFlags() {
p.From.Type = obj.TYPE_REG
- p.From.Reg = b.Control.Reg()
+ p.From.Reg = b.Controls[0].Reg()
}
case ssa.BlockARM64TBZ, ssa.BlockARM64TBNZ:
jmp := blockJump[b.Kind]
@@ -1080,9 +1080,9 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
}
p.From.Offset = b.Aux.(int64)
p.From.Type = obj.TYPE_CONST
- p.Reg = b.Control.Reg()
+ p.Reg = b.Controls[0].Reg()
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/compile/internal/gc/escape.go b/src/cmd/compile/internal/gc/escape.go
index d04303134a..ebe5403186 100644
--- a/src/cmd/compile/internal/gc/escape.go
+++ b/src/cmd/compile/internal/gc/escape.go
@@ -361,18 +361,18 @@ func (e *Escape) stmt(n *Node) {
}
case OAS2DOTTYPE: // v, ok = x.(type)
- e.assign(n.List.First(), n.Rlist.First(), "assign-pair-dot-type", n)
+ e.assign(n.List.First(), n.Right, "assign-pair-dot-type", n)
e.assign(n.List.Second(), nil, "assign-pair-dot-type", n)
case OAS2MAPR: // v, ok = m[k]
- e.assign(n.List.First(), n.Rlist.First(), "assign-pair-mapr", n)
+ e.assign(n.List.First(), n.Right, "assign-pair-mapr", n)
e.assign(n.List.Second(), nil, "assign-pair-mapr", n)
case OAS2RECV: // v, ok = <-ch
- e.assign(n.List.First(), n.Rlist.First(), "assign-pair-receive", n)
+ e.assign(n.List.First(), n.Right, "assign-pair-receive", n)
e.assign(n.List.Second(), nil, "assign-pair-receive", n)
case OAS2FUNC:
- e.stmts(n.Rlist.First().Ninit)
- e.call(e.addrs(n.List), n.Rlist.First(), nil)
+ e.stmts(n.Right.Ninit)
+ e.call(e.addrs(n.List), n.Right, nil)
case ORETURN:
results := e.curfn.Type.Results().FieldSlice()
for i, v := range n.List.Slice() {
diff --git a/src/cmd/compile/internal/gc/export.go b/src/cmd/compile/internal/gc/export.go
index 31e6ab5b6d..44bea2b1fd 100644
--- a/src/cmd/compile/internal/gc/export.go
+++ b/src/cmd/compile/internal/gc/export.go
@@ -71,7 +71,7 @@ func dumpexport(bout *bio.Writer) {
exportf(bout, "\n$$\n")
if Debug_export != 0 {
- fmt.Printf("export data size = %d bytes\n", size)
+ fmt.Printf("BenchmarkExportSize:%s 1 %d bytes\n", myimportpath, size)
}
}
diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go
index 7b974cc866..3bb2df9917 100644
--- a/src/cmd/compile/internal/gc/fmt.go
+++ b/src/cmd/compile/internal/gc/fmt.go
@@ -945,7 +945,7 @@ func (n *Node) stmtfmt(s fmt.State, mode fmtMode) {
fallthrough
case OAS2DOTTYPE, OAS2FUNC, OAS2MAPR, OAS2RECV:
- mode.Fprintf(s, "%.v = %.v", n.List, n.Rlist)
+ mode.Fprintf(s, "%.v = %v", n.List, n.Right)
case ORETURN:
mode.Fprintf(s, "return %.v", n.List)
diff --git a/src/cmd/compile/internal/gc/iexport.go b/src/cmd/compile/internal/gc/iexport.go
index 39f7770136..9125f67586 100644
--- a/src/cmd/compile/internal/gc/iexport.go
+++ b/src/cmd/compile/internal/gc/iexport.go
@@ -184,8 +184,9 @@
// }
//
//
-// Pos encodes a file:line pair, incorporating a simple delta encoding
-// scheme within a data object. See exportWriter.pos for details.
+// Pos encodes a file:line:column triple, incorporating a simple delta
+// encoding scheme within a data object. See exportWriter.pos for
+// details.
//
//
// Compiler-specific details.
@@ -213,8 +214,9 @@ import (
)
// Current indexed export format version. Increase with each format change.
+// 1: added column details to Pos
// 0: Go1.11 encoding
-const iexportVersion = 0
+const iexportVersion = 1
// predeclReserved is the number of type offsets reserved for types
// implicitly declared in the universe block.
@@ -402,10 +404,11 @@ func (p *iexporter) pushDecl(n *Node) {
type exportWriter struct {
p *iexporter
- data intWriter
- currPkg *types.Pkg
- prevFile string
- prevLine int64
+ data intWriter
+ currPkg *types.Pkg
+ prevFile string
+ prevLine int64
+ prevColumn int64
}
func (p *iexporter) doDecl(n *Node) {
@@ -511,29 +514,39 @@ func (w *exportWriter) pos(pos src.XPos) {
p := Ctxt.PosTable.Pos(pos)
file := p.Base().AbsFilename()
line := int64(p.RelLine())
+ column := int64(p.RelCol())
- // When file is the same as the last position (common case),
- // we can save a few bytes by delta encoding just the line
- // number.
+ // Encode position relative to the last position: column
+ // delta, then line delta, then file name. We reserve the
+ // bottom bit of the column and line deltas to encode whether
+ // the remaining fields are present.
//
// Note: Because data objects may be read out of order (or not
// at all), we can only apply delta encoding within a single
- // object. This is handled implicitly by tracking prevFile and
- // prevLine as fields of exportWriter.
+ // object. This is handled implicitly by tracking prevFile,
+ // prevLine, and prevColumn as fields of exportWriter.
- if file == w.prevFile {
- delta := line - w.prevLine
- w.int64(delta)
- if delta == deltaNewFile {
- w.int64(-1)
+ deltaColumn := (column - w.prevColumn) << 1
+ deltaLine := (line - w.prevLine) << 1
+
+ if file != w.prevFile {
+ deltaLine |= 1
+ }
+ if deltaLine != 0 {
+ deltaColumn |= 1
+ }
+
+ w.int64(deltaColumn)
+ if deltaColumn&1 != 0 {
+ w.int64(deltaLine)
+ if deltaLine&1 != 0 {
+ w.string(file)
}
- } else {
- w.int64(deltaNewFile)
- w.int64(line) // line >= 0
- w.string(file)
- w.prevFile = file
}
+
+ w.prevFile = file
w.prevLine = line
+ w.prevColumn = column
}
func (w *exportWriter) pkg(pkg *types.Pkg) {
@@ -1045,12 +1058,18 @@ func (w *exportWriter) stmt(n *Node) {
w.expr(n.Right)
}
- case OAS2, OAS2DOTTYPE, OAS2FUNC, OAS2MAPR, OAS2RECV:
+ case OAS2:
w.op(OAS2)
w.pos(n.Pos)
w.exprList(n.List)
w.exprList(n.Rlist)
+ case OAS2DOTTYPE, OAS2FUNC, OAS2MAPR, OAS2RECV:
+ w.op(OAS2)
+ w.pos(n.Pos)
+ w.exprList(n.List)
+ w.exprList(asNodes([]*Node{n.Right}))
+
case ORETURN:
w.op(ORETURN)
w.pos(n.Pos)
diff --git a/src/cmd/compile/internal/gc/iimport.go b/src/cmd/compile/internal/gc/iimport.go
index 96d7e0257a..824648acb6 100644
--- a/src/cmd/compile/internal/gc/iimport.go
+++ b/src/cmd/compile/internal/gc/iimport.go
@@ -243,9 +243,10 @@ type importReader struct {
strings.Reader
p *iimporter
- currPkg *types.Pkg
- prevBase *src.PosBase
- prevLine int64
+ currPkg *types.Pkg
+ prevBase *src.PosBase
+ prevLine int64
+ prevColumn int64
}
func (p *iimporter) newReader(off uint64, pkg *types.Pkg) *importReader {
@@ -447,16 +448,16 @@ func (r *importReader) qualifiedIdent() *types.Sym {
func (r *importReader) pos() src.XPos {
delta := r.int64()
- if delta != deltaNewFile {
- r.prevLine += delta
- } else if l := r.int64(); l == -1 {
- r.prevLine += deltaNewFile
- } else {
- r.prevBase = r.posBase()
- r.prevLine = l
+ r.prevColumn += delta >> 1
+ if delta&1 != 0 {
+ delta = r.int64()
+ r.prevLine += delta >> 1
+ if delta&1 != 0 {
+ r.prevBase = r.posBase()
+ }
}
- if (r.prevBase == nil || r.prevBase.AbsFilename() == "") && r.prevLine == 0 {
+ if (r.prevBase == nil || r.prevBase.AbsFilename() == "") && r.prevLine == 0 && r.prevColumn == 0 {
// TODO(mdempsky): Remove once we reliably write
// position information for all nodes.
return src.NoXPos
@@ -465,7 +466,7 @@ func (r *importReader) pos() src.XPos {
if r.prevBase == nil {
Fatalf("missing posbase")
}
- pos := src.MakePos(r.prevBase, uint(r.prevLine), 0)
+ pos := src.MakePos(r.prevBase, uint(r.prevLine), uint(r.prevColumn))
return Ctxt.PosTable.XPos(pos)
}
diff --git a/src/cmd/compile/internal/gc/initorder.go b/src/cmd/compile/internal/gc/initorder.go
index be1e671d17..41f1349bbe 100644
--- a/src/cmd/compile/internal/gc/initorder.go
+++ b/src/cmd/compile/internal/gc/initorder.go
@@ -254,7 +254,7 @@ func collectDeps(n *Node, transitive bool) NodeSet {
case OAS:
d.inspect(n.Right)
case OAS2DOTTYPE, OAS2FUNC, OAS2MAPR, OAS2RECV:
- d.inspect(n.Rlist.First())
+ d.inspect(n.Right)
case ODCLFUNC:
d.inspectList(n.Nbody)
default:
diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go
index b41b8cb1a4..4a376305bb 100644
--- a/src/cmd/compile/internal/gc/inl.go
+++ b/src/cmd/compile/internal/gc/inl.go
@@ -580,6 +580,12 @@ func inlnode(n *Node, maxCost int32) *Node {
if n.Right != nil && n.Right.Op == OINLCALL {
if n.Op == OFOR || n.Op == OFORUNTIL {
inlconv2stmt(n.Right)
+ } else if n.Op == OAS2FUNC {
+ n.Rlist.Set(inlconv2list(n.Right))
+ n.Right = nil
+ n.Op = OAS2
+ n.SetTypecheck(0)
+ n = typecheck(n, ctxStmt)
} else {
n.Right = inlconv2expr(n.Right)
}
@@ -602,20 +608,13 @@ func inlnode(n *Node, maxCost int32) *Node {
}
inlnodelist(n.Rlist, maxCost)
- if n.Op == OAS2FUNC && n.Rlist.First().Op == OINLCALL {
- n.Rlist.Set(inlconv2list(n.Rlist.First()))
- n.Op = OAS2
- n.SetTypecheck(0)
- n = typecheck(n, ctxStmt)
- } else {
- s := n.Rlist.Slice()
- for i1, n1 := range s {
- if n1.Op == OINLCALL {
- if n.Op == OIF {
- inlconv2stmt(n1)
- } else {
- s[i1] = inlconv2expr(s[i1])
- }
+ s := n.Rlist.Slice()
+ for i1, n1 := range s {
+ if n1.Op == OINLCALL {
+ if n.Op == OIF {
+ inlconv2stmt(n1)
+ } else {
+ s[i1] = inlconv2expr(s[i1])
}
}
}
diff --git a/src/cmd/compile/internal/gc/inl_test.go b/src/cmd/compile/internal/gc/inl_test.go
index a0f56e776b..77c398af82 100644
--- a/src/cmd/compile/internal/gc/inl_test.go
+++ b/src/cmd/compile/internal/gc/inl_test.go
@@ -148,6 +148,10 @@ func TestIntendedInlining(t *testing.T) {
"addVW",
"subVW",
},
+ "math/rand": {
+ "(*rngSource).Int63",
+ "(*rngSource).Uint64",
+ },
}
if runtime.GOARCH != "386" && runtime.GOARCH != "mips64" && runtime.GOARCH != "mips64le" {
diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go
index 2922f9a872..a4f834b5ab 100644
--- a/src/cmd/compile/internal/gc/noder.go
+++ b/src/cmd/compile/internal/gc/noder.go
@@ -1327,7 +1327,7 @@ func checkLangCompat(lit *syntax.BasicLit) {
}
// len(s) > 2
if strings.Contains(s, "_") {
- yyerror("underscores in numeric literals only supported as of -lang=go1.13")
+ yyerrorv("go1.13", "underscores in numeric literals")
return
}
if s[0] != '0' {
@@ -1335,15 +1335,15 @@ func checkLangCompat(lit *syntax.BasicLit) {
}
base := s[1]
if base == 'b' || base == 'B' {
- yyerror("binary literals only supported as of -lang=go1.13")
+ yyerrorv("go1.13", "binary literals")
return
}
if base == 'o' || base == 'O' {
- yyerror("0o/0O-style octal literals only supported as of -lang=go1.13")
+ yyerrorv("go1.13", "0o/0O-style octal literals")
return
}
if lit.Kind != syntax.IntLit && (base == 'x' || base == 'X') {
- yyerror("hexadecimal floating-point literals only supported as of -lang=go1.13")
+ yyerrorv("go1.13", "hexadecimal floating-point literals")
}
}
diff --git a/src/cmd/compile/internal/gc/order.go b/src/cmd/compile/internal/gc/order.go
index e6350ef721..2ab87a2f7b 100644
--- a/src/cmd/compile/internal/gc/order.go
+++ b/src/cmd/compile/internal/gc/order.go
@@ -89,7 +89,7 @@ func (o *Order) newTemp(t *types.Type, clear bool) *Node {
return v
}
-// copyExpr behaves like ordertemp but also emits
+// copyExpr behaves like newTemp but also emits
// code to initialize the temporary to the value n.
//
// The clear argument is provided for use when the evaluation
@@ -181,12 +181,12 @@ func (o *Order) safeExpr(n *Node) *Node {
return typecheck(a, ctxExpr)
default:
- Fatalf("ordersafeexpr %v", n.Op)
+ Fatalf("order.safeExpr %v", n.Op)
return nil // not reached
}
}
-// Isaddrokay reports whether it is okay to pass n's address to runtime routines.
+// isaddrokay reports whether it is okay to pass n's address to runtime routines.
// Taking the address of a variable makes the liveness and optimization analyses
// lose track of where the variable's lifetime ends. To avoid hurting the analyses
// of ordinary stack variables, those are not 'isaddrokay'. Temporaries are okay,
@@ -274,13 +274,13 @@ func mapKeyReplaceStrConv(n *Node) bool {
type ordermarker int
-// Marktemp returns the top of the temporary variable stack.
+// markTemp returns the top of the temporary variable stack.
func (o *Order) markTemp() ordermarker {
return ordermarker(len(o.temp))
}
-// Poptemp pops temporaries off the stack until reaching the mark,
-// which must have been returned by marktemp.
+// popTemp pops temporaries off the stack until reaching the mark,
+// which must have been returned by markTemp.
func (o *Order) popTemp(mark ordermarker) {
for _, n := range o.temp[mark:] {
key := n.Type.LongString()
@@ -289,7 +289,7 @@ func (o *Order) popTemp(mark ordermarker) {
o.temp = o.temp[:mark]
}
-// Cleantempnopop emits VARKILL and if needed VARLIVE instructions
+// cleanTempNoPop emits VARKILL and if needed VARLIVE instructions
// to *out for each temporary above the mark on the temporary stack.
// It does not pop the temporaries from the stack.
func (o *Order) cleanTempNoPop(mark ordermarker) []*Node {
@@ -372,7 +372,7 @@ func (o *Order) init(n *Node) {
// For concurrency safety, don't mutate potentially shared nodes.
// First, ensure that no work is required here.
if n.Ninit.Len() > 0 {
- Fatalf("orderinit shared node with ninit")
+ Fatalf("order.init shared node with ninit")
}
return
}
@@ -445,7 +445,7 @@ func (o *Order) call(n *Node) {
func (o *Order) mapAssign(n *Node) {
switch n.Op {
default:
- Fatalf("ordermapassign %v", n.Op)
+ Fatalf("order.mapAssign %v", n.Op)
case OAS, OASOP:
if n.Left.Op == OINDEXMAP {
@@ -501,7 +501,7 @@ func (o *Order) stmt(n *Node) {
switch n.Op {
default:
- Fatalf("orderstmt %v", n.Op)
+ Fatalf("order.stmt %v", n.Op)
case OVARKILL, OVARLIVE, OINLMARK:
o.out = append(o.out, n)
@@ -567,7 +567,7 @@ func (o *Order) stmt(n *Node) {
case OAS2MAPR:
t := o.markTemp()
o.exprList(n.List)
- r := n.Rlist.First()
+ r := n.Right
r.Left = o.expr(r.Left, nil)
r.Right = o.expr(r.Right, nil)
@@ -582,8 +582,8 @@ func (o *Order) stmt(n *Node) {
case OAS2FUNC:
t := o.markTemp()
o.exprList(n.List)
- o.init(n.Rlist.First())
- o.call(n.Rlist.First())
+ o.init(n.Right)
+ o.call(n.Right)
o.as2(n)
o.cleanTemp(t)
@@ -593,7 +593,7 @@ func (o *Order) stmt(n *Node) {
case OAS2DOTTYPE:
t := o.markTemp()
o.exprList(n.List)
- n.Rlist.First().Left = o.expr(n.Rlist.First().Left, nil) // i in i.(T)
+ n.Right.Left = o.expr(n.Right.Left, nil) // i in i.(T)
o.okAs2(n)
o.cleanTemp(t)
@@ -602,8 +602,8 @@ func (o *Order) stmt(n *Node) {
case OAS2RECV:
t := o.markTemp()
o.exprList(n.List)
- n.Rlist.First().Left = o.expr(n.Rlist.First().Left, nil) // arg to recv
- ch := n.Rlist.First().Left.Type
+ n.Right.Left = o.expr(n.Right.Left, nil) // arg to recv
+ ch := n.Right.Left.Type
tmp1 := o.newTemp(ch.Elem(), types.Haspointers(ch.Elem()))
tmp2 := o.newTemp(types.Types[TBOOL], false)
o.out = append(o.out, n)
@@ -713,7 +713,7 @@ func (o *Order) stmt(n *Node) {
orderBody := true
switch n.Type.Etype {
default:
- Fatalf("orderstmt range %v", n.Type)
+ Fatalf("order.stmt range %v", n.Type)
case TARRAY, TSLICE:
if n.List.Len() < 2 || n.List.Second().isBlank() {
@@ -930,7 +930,7 @@ func (o *Order) stmt(n *Node) {
// TODO(rsc): Clean temporaries more aggressively.
// Note that because walkswitch will rewrite some of the
// switch into a binary search, this is not as easy as it looks.
- // (If we ran that code here we could invoke orderstmt on
+ // (If we ran that code here we could invoke order.stmt on
// the if-else chain instead.)
// For now just clean all the temporaries at the end.
// In practice that's fine.
@@ -1343,7 +1343,7 @@ func (o *Order) as2(n *Node) {
func (o *Order) okAs2(n *Node) {
var tmp1, tmp2 *Node
if !n.List.First().isBlank() {
- typ := n.Rlist.First().Type
+ typ := n.Right.Type
tmp1 = o.newTemp(typ, types.Haspointers(typ))
}
diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go
index 16a752c893..8809a644d5 100644
--- a/src/cmd/compile/internal/gc/plive.go
+++ b/src/cmd/compile/internal/gc/plive.go
@@ -670,7 +670,7 @@ func (lv *Liveness) markUnsafePoints() {
// single op that does the memory load from the flag
// address, so we look for that.
var load *ssa.Value
- v := wbBlock.Control
+ v := wbBlock.Controls[0]
for {
if sym, ok := v.Aux.(*obj.LSym); ok && sym == writeBarrier {
load = v
diff --git a/src/cmd/compile/internal/gc/range.go b/src/cmd/compile/internal/gc/range.go
index 4d354f23cf..4744324a7c 100644
--- a/src/cmd/compile/internal/gc/range.go
+++ b/src/cmd/compile/internal/gc/range.go
@@ -343,7 +343,7 @@ func walkrange(n *Node) *Node {
a := nod(OAS2RECV, nil, nil)
a.SetTypecheck(1)
a.List.Set2(hv1, hb)
- a.Rlist.Set1(nod(ORECV, ha, nil))
+ a.Right = nod(ORECV, ha, nil)
n.Left.Ninit.Set1(a)
if v1 == nil {
body = nil
diff --git a/src/cmd/compile/internal/gc/select.go b/src/cmd/compile/internal/gc/select.go
index 07c5c5a2a9..49cc23cd3d 100644
--- a/src/cmd/compile/internal/gc/select.go
+++ b/src/cmd/compile/internal/gc/select.go
@@ -60,7 +60,7 @@ func typecheckselect(sel *Node) {
// convert x, ok = <-c into OSELRECV2(x, <-c) with ntest=ok
case OAS2RECV:
- if n.Rlist.First().Op != ORECV {
+ if n.Right.Op != ORECV {
yyerrorl(n.Pos, "select assignment must have receive on right hand side")
break
}
@@ -68,8 +68,6 @@ func typecheckselect(sel *Node) {
n.Op = OSELRECV2
n.Left = n.List.First()
n.List.Set1(n.List.Second())
- n.Right = n.Rlist.First()
- n.Rlist.Set(nil)
// convert <-c into OSELRECV(N, <-c)
case ORECV:
diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go
index ae16d41b1c..a6d13d1ac5 100644
--- a/src/cmd/compile/internal/gc/sinit.go
+++ b/src/cmd/compile/internal/gc/sinit.go
@@ -83,6 +83,9 @@ func (s *InitSchedule) staticcopy(l *Node, r *Node) bool {
if r.Name.Defn.Op != OAS {
return false
}
+ if r.Type.IsString() { // perhaps overwritten by cmd/link -X (#34675)
+ return false
+ }
orig := r
r = r.Name.Defn.Right
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index 7b0c7e5c43..a263fa7e99 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -874,9 +874,9 @@ func (s *state) stmt(n *Node) {
s.call(n.Left, callGo)
case OAS2DOTTYPE:
- res, resok := s.dottype(n.Rlist.First(), true)
+ res, resok := s.dottype(n.Right, true)
deref := false
- if !canSSAType(n.Rlist.First().Type) {
+ if !canSSAType(n.Right.Type) {
if res.Op != ssa.OpLoad {
s.Fatalf("dottype of non-load")
}
@@ -896,10 +896,10 @@ func (s *state) stmt(n *Node) {
case OAS2FUNC:
// We come here only when it is an intrinsic call returning two values.
- if !isIntrinsicCall(n.Rlist.First()) {
- s.Fatalf("non-intrinsic AS2FUNC not expanded %v", n.Rlist.First())
+ if !isIntrinsicCall(n.Right) {
+ s.Fatalf("non-intrinsic AS2FUNC not expanded %v", n.Right)
}
- v := s.intrinsicCall(n.Rlist.First())
+ v := s.intrinsicCall(n.Right)
v1 := s.newValue1(ssa.OpSelect0, n.List.First().Type, v)
v2 := s.newValue1(ssa.OpSelect1, n.List.Second().Type, v)
s.assign(n.List.First(), v1, false, 0)
@@ -3671,7 +3671,7 @@ func init() {
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
return s.newValue2(ssa.OpMul64uhilo, types.NewTuple(types.Types[TUINT64], types.Types[TUINT64]), args[0], args[1])
},
- sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64LE, sys.ArchPPC64)
+ sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64LE, sys.ArchPPC64, sys.ArchS390X)
add("math/big", "divWW",
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
return s.newValue3(ssa.OpDiv128u, types.NewTuple(types.Types[TUINT64], types.Types[TUINT64]), args[0], args[1], args[2])
@@ -5238,8 +5238,11 @@ func (s *SSAGenState) DebugFriendlySetPosFrom(v *ssa.Value) {
// in the generated code.
if p.IsStmt() != src.PosIsStmt {
p = p.WithNotStmt()
+ // Calls use the pos attached to v, but copy the statement mark from SSAGenState
}
s.SetPos(p)
+ } else {
+ s.SetPos(s.pp.pos.WithNotStmt())
}
}
}
@@ -5878,10 +5881,15 @@ func (s *SSAGenState) AddrScratch(a *obj.Addr) {
// Call returns a new CALL instruction for the SSA value v.
// It uses PrepareCall to prepare the call.
func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog {
+ pPosIsStmt := s.pp.pos.IsStmt() // The statement-ness fo the call comes from ssaGenState
s.PrepareCall(v)
p := s.Prog(obj.ACALL)
- p.Pos = v.Pos
+ if pPosIsStmt == src.PosIsStmt {
+ p.Pos = v.Pos.WithIsStmt()
+ } else {
+ p.Pos = v.Pos.WithNotStmt()
+ }
if sym, ok := v.Aux.(*obj.LSym); ok {
p.To.Type = obj.TYPE_MEM
p.To.Name = obj.NAME_EXTERN
diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go
index b4be5dcbfb..27326f67a1 100644
--- a/src/cmd/compile/internal/gc/subr.go
+++ b/src/cmd/compile/internal/gc/subr.go
@@ -154,6 +154,11 @@ func yyerrorl(pos src.XPos, format string, args ...interface{}) {
}
}
+func yyerrorv(lang string, format string, args ...interface{}) {
+ what := fmt.Sprintf(format, args...)
+ yyerrorl(lineno, "%s requires %s or later (-lang was set to %s; check go.mod)", what, lang, flag_lang)
+}
+
func yyerror(format string, args ...interface{}) {
yyerrorl(lineno, format, args...)
}
@@ -1184,7 +1189,12 @@ func lookdot0(s *types.Sym, t *types.Type, save **types.Field, ignorecase bool)
}
}
- u = methtype(t)
+ u = t
+ if t.Sym != nil && t.IsPtr() && !t.Elem().IsPtr() {
+ // If t is a defined pointer type, then x.m is shorthand for (*x).m.
+ u = t.Elem()
+ }
+ u = methtype(u)
if u != nil {
for _, f := range u.Methods().Slice() {
if f.Embedded == 0 && (f.Sym == s || (ignorecase && strings.EqualFold(f.Sym.Name, s.Name))) {
diff --git a/src/cmd/compile/internal/gc/swt.go b/src/cmd/compile/internal/gc/swt.go
index a97e9735da..1381cdacba 100644
--- a/src/cmd/compile/internal/gc/swt.go
+++ b/src/cmd/compile/internal/gc/swt.go
@@ -268,7 +268,6 @@ func walkExprSwitch(sw *Node) {
exprname: cond,
}
- br := nod(OBREAK, nil, nil)
var defaultGoto *Node
var body Nodes
for _, ncase := range sw.List.Slice() {
@@ -290,13 +289,17 @@ func walkExprSwitch(sw *Node) {
// Process body.
body.Append(npos(ncase.Pos, nodSym(OLABEL, nil, label)))
body.Append(ncase.Nbody.Slice()...)
- if !hasFall(ncase.Nbody.Slice()) {
+ if fall, pos := hasFall(ncase.Nbody.Slice()); !fall {
+ br := nod(OBREAK, nil, nil)
+ br.Pos = pos
body.Append(br)
}
}
sw.List.Set(nil)
if defaultGoto == nil {
+ br := nod(OBREAK, nil, nil)
+ br.Pos = br.Pos.WithNotStmt()
defaultGoto = br
}
@@ -469,7 +472,7 @@ func allCaseExprsAreSideEffectFree(sw *Node) bool {
}
// hasFall reports whether stmts ends with a "fallthrough" statement.
-func hasFall(stmts []*Node) bool {
+func hasFall(stmts []*Node) (bool, src.XPos) {
// Search backwards for the index of the fallthrough
// statement. Do not assume it'll be in the last
// position, since in some cases (e.g. when the statement
@@ -480,7 +483,10 @@ func hasFall(stmts []*Node) bool {
for i >= 0 && stmts[i].Op == OVARKILL {
i--
}
- return i >= 0 && stmts[i].Op == OFALL
+ if i < 0 {
+ return false, src.NoXPos
+ }
+ return stmts[i].Op == OFALL, stmts[i].Pos
}
// walkTypeSwitch generates an AST that implements sw, where sw is a
diff --git a/src/cmd/compile/internal/gc/syntax.go b/src/cmd/compile/internal/gc/syntax.go
index c26ed6251b..c1df046654 100644
--- a/src/cmd/compile/internal/gc/syntax.go
+++ b/src/cmd/compile/internal/gc/syntax.go
@@ -600,10 +600,10 @@ const (
OSTR2RUNES // Type(Left) (Type is []rune, Left is a string)
OAS // Left = Right or (if Colas=true) Left := Right
OAS2 // List = Rlist (x, y, z = a, b, c)
- OAS2DOTTYPE // List = Rlist (x, ok = I.(int))
- OAS2FUNC // List = Rlist (x, y = f())
- OAS2MAPR // List = Rlist (x, ok = m["foo"])
- OAS2RECV // List = Rlist (x, ok = <-c)
+ OAS2DOTTYPE // List = Right (x, ok = I.(int))
+ OAS2FUNC // List = Right (x, y = f())
+ OAS2MAPR // List = Right (x, ok = m["foo"])
+ OAS2RECV // List = Right (x, ok = <-c)
OASOP // Left Etype= Right (x += y)
OCALL // Left(List) (function call, method call or type conversion)
diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go
index ab45fb5a2d..d5483c9ce5 100644
--- a/src/cmd/compile/internal/gc/typecheck.go
+++ b/src/cmd/compile/internal/gc/typecheck.go
@@ -604,7 +604,7 @@ func typecheck1(n *Node, top int) (res *Node) {
return n
}
if t.IsSigned() && !langSupported(1, 13) {
- yyerror("invalid operation: %v (signed shift count type %v, only supported as of -lang=go1.13)", n, r.Type)
+ yyerrorv("go1.13", "invalid operation: %v (signed shift count type %v)", n, r.Type)
n.Type = nil
return n
}
@@ -3275,6 +3275,8 @@ func typecheckas2(n *Node) {
goto mismatch
}
n.Op = OAS2FUNC
+ n.Right = r
+ n.Rlist.Set(nil)
for i, l := range n.List.Slice() {
f := r.Type.Field(i)
if f.Type != nil && l.Type != nil {
@@ -3298,15 +3300,14 @@ func typecheckas2(n *Node) {
switch r.Op {
case OINDEXMAP:
n.Op = OAS2MAPR
-
case ORECV:
n.Op = OAS2RECV
-
case ODOTTYPE:
n.Op = OAS2DOTTYPE
r.Op = ODOTTYPE2
}
-
+ n.Right = r
+ n.Rlist.Set(nil)
if l.Type != nil {
checkassignto(r.Type, l)
}
diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go
index ceec1b4dc1..727c8102ae 100644
--- a/src/cmd/compile/internal/gc/walk.go
+++ b/src/cmd/compile/internal/gc/walk.go
@@ -691,12 +691,12 @@ opswitch:
case OAS2FUNC:
init.AppendNodes(&n.Ninit)
- r := n.Rlist.First()
+ r := n.Right
walkexprlistsafe(n.List.Slice(), init)
r = walkexpr(r, init)
if isIntrinsicCall(r) {
- n.Rlist.Set1(r)
+ n.Right = r
break
}
init.Append(r)
@@ -709,7 +709,7 @@ opswitch:
case OAS2RECV:
init.AppendNodes(&n.Ninit)
- r := n.Rlist.First()
+ r := n.Right
walkexprlistsafe(n.List.Slice(), init)
r.Left = walkexpr(r.Left, init)
var n1 *Node
@@ -728,7 +728,7 @@ opswitch:
case OAS2MAPR:
init.AppendNodes(&n.Ninit)
- r := n.Rlist.First()
+ r := n.Right
walkexprlistsafe(n.List.Slice(), init)
r.Left = walkexpr(r.Left, init)
r.Right = walkexpr(r.Right, init)
@@ -767,7 +767,7 @@ opswitch:
if ok := n.List.Second(); !ok.isBlank() && ok.Type.IsBoolean() {
r.Type.Field(1).Type = ok.Type
}
- n.Rlist.Set1(r)
+ n.Right = r
n.Op = OAS2FUNC
// don't generate a = *var if a is _
@@ -801,7 +801,7 @@ opswitch:
case OAS2DOTTYPE:
walkexprlistsafe(n.List.Slice(), init)
- n.Rlist.SetFirst(walkexpr(n.Rlist.First(), init))
+ n.Right = walkexpr(n.Right, init)
case OCONVIFACE:
n.Left = walkexpr(n.Left, init)
@@ -3125,35 +3125,15 @@ func walkcompare(n *Node, init *Nodes) *Node {
// Chose not to inline. Call equality function directly.
if !inline {
- if isvaluelit(cmpl) {
- var_ := temp(cmpl.Type)
- anylit(cmpl, var_, init)
- cmpl = var_
- }
- if isvaluelit(cmpr) {
- var_ := temp(cmpr.Type)
- anylit(cmpr, var_, init)
- cmpr = var_
- }
+ // eq algs take pointers; cmpl and cmpr must be addressable
if !islvalue(cmpl) || !islvalue(cmpr) {
Fatalf("arguments of comparison must be lvalues - %v %v", cmpl, cmpr)
}
- // eq algs take pointers
- pl := temp(types.NewPtr(t))
- al := nod(OAS, pl, nod(OADDR, cmpl, nil))
- al = typecheck(al, ctxStmt)
- init.Append(al)
-
- pr := temp(types.NewPtr(t))
- ar := nod(OAS, pr, nod(OADDR, cmpr, nil))
- ar = typecheck(ar, ctxStmt)
- init.Append(ar)
-
fn, needsize := eqfor(t)
call := nod(OCALL, fn, nil)
- call.List.Append(pl)
- call.List.Append(pr)
+ call.List.Append(nod(OADDR, cmpl, nil))
+ call.List.Append(nod(OADDR, cmpr, nil))
if needsize {
call.List.Append(nodintconst(t.Width))
}
diff --git a/src/cmd/compile/internal/gc/zerorange_test.go b/src/cmd/compile/internal/gc/zerorange_test.go
new file mode 100644
index 0000000000..89f4cb9bcf
--- /dev/null
+++ b/src/cmd/compile/internal/gc/zerorange_test.go
@@ -0,0 +1,98 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package gc
+
+import (
+ "testing"
+)
+
+var glob = 3
+var globp *int64
+
+// Testing compilation of arch.ZeroRange of various sizes.
+
+// By storing a pointer to an int64 output param in a global, the compiler must
+// ensure that output param is allocated on the heap. Also, since there is a
+// defer, the pointer to each output param must be zeroed in the prologue (see
+// plive.go:epilogue()). So, we will get a block of one or more stack slots that
+// need to be zeroed. Hence, we are testing compilation completes successfully when
+// zerorange calls of various sizes (8-136 bytes) are generated. We are not
+// testing runtime correctness (which is hard to do for the current uses of
+// ZeroRange).
+
+func TestZeroRange(t *testing.T) {
+ testZeroRange8(t)
+ testZeroRange16(t)
+ testZeroRange32(t)
+ testZeroRange64(t)
+ testZeroRange136(t)
+}
+
+func testZeroRange8(t *testing.T) (r int64) {
+ defer func() {
+ glob = 4
+ }()
+ globp = &r
+ return
+}
+
+func testZeroRange16(t *testing.T) (r, s int64) {
+ defer func() {
+ glob = 4
+ }()
+ globp = &r
+ globp = &s
+ return
+}
+
+func testZeroRange32(t *testing.T) (r, s, t2, u int64) {
+ defer func() {
+ glob = 4
+ }()
+ globp = &r
+ globp = &s
+ globp = &t2
+ globp = &u
+ return
+}
+
+func testZeroRange64(t *testing.T) (r, s, t2, u, v, w, x, y int64) {
+ defer func() {
+ glob = 4
+ }()
+ globp = &r
+ globp = &s
+ globp = &t2
+ globp = &u
+ globp = &v
+ globp = &w
+ globp = &x
+ globp = &y
+ return
+}
+
+func testZeroRange136(t *testing.T) (r, s, t2, u, v, w, x, y, r1, s1, t1, u1, v1, w1, x1, y1, z1 int64) {
+ defer func() {
+ glob = 4
+ }()
+ globp = &r
+ globp = &s
+ globp = &t2
+ globp = &u
+ globp = &v
+ globp = &w
+ globp = &x
+ globp = &y
+ globp = &r1
+ globp = &s1
+ globp = &t1
+ globp = &u1
+ globp = &v1
+ globp = &w1
+ globp = &x1
+ globp = &y1
+ globp = &z1
+ return
+}
diff --git a/src/cmd/compile/internal/mips/ssa.go b/src/cmd/compile/internal/mips/ssa.go
index 19b7c95bfd..bac8574b5c 100644
--- a/src/cmd/compile/internal/mips/ssa.go
+++ b/src/cmd/compile/internal/mips/ssa.go
@@ -855,11 +855,11 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
s.Br(obj.AJMP, b.Succs[0].Block())
}
}
- if !b.Control.Type.IsFlags() {
+ if !b.Controls[0].Type.IsFlags() {
p.From.Type = obj.TYPE_REG
- p.From.Reg = b.Control.Reg()
+ p.From.Reg = b.Controls[0].Reg()
}
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/compile/internal/mips64/ssa.go b/src/cmd/compile/internal/mips64/ssa.go
index 7eae35373d..a70db3576c 100644
--- a/src/cmd/compile/internal/mips64/ssa.go
+++ b/src/cmd/compile/internal/mips64/ssa.go
@@ -829,11 +829,11 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
s.Br(obj.AJMP, b.Succs[0].Block())
}
}
- if !b.Control.Type.IsFlags() {
+ if !b.Controls[0].Type.IsFlags() {
p.From.Type = obj.TYPE_REG
- p.From.Reg = b.Control.Reg()
+ p.From.Reg = b.Controls[0].Reg()
}
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/compile/internal/ppc64/ssa.go b/src/cmd/compile/internal/ppc64/ssa.go
index a12b256680..69847c38d2 100644
--- a/src/cmd/compile/internal/ppc64/ssa.go
+++ b/src/cmd/compile/internal/ppc64/ssa.go
@@ -1337,6 +1337,6 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
}
}
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/compile/internal/s390x/ssa.go b/src/cmd/compile/internal/s390x/ssa.go
index 74e63b9f42..15cb553eff 100644
--- a/src/cmd/compile/internal/s390x/ssa.go
+++ b/src/cmd/compile/internal/s390x/ssa.go
@@ -17,8 +17,8 @@ import (
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
func ssaMarkMoves(s *gc.SSAGenState, b *ssa.Block) {
flive := b.FlagsLiveAtEnd
- if b.Control != nil && b.Control.Type.IsFlags() {
- flive = true
+ for _, c := range b.ControlValues() {
+ flive = c.Type.IsFlags() || flive
}
for i := len(b.Values) - 1; i >= 0; i-- {
v := b.Values[i]
@@ -237,7 +237,6 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
p.From.Reg = r0
p.To.Reg = s390x.REG_R2
p.To.Type = obj.TYPE_REG
-
case ssa.OpS390XFMADD, ssa.OpS390XFMADDS,
ssa.OpS390XFMSUB, ssa.OpS390XFMSUBS:
r := v.Reg()
@@ -864,6 +863,6 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
s.Br(s390x.ABR, succs[1])
}
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/compile/internal/ssa/README.md b/src/cmd/compile/internal/ssa/README.md
index d283118011..4483c2c85f 100644
--- a/src/cmd/compile/internal/ssa/README.md
+++ b/src/cmd/compile/internal/ssa/README.md
@@ -82,10 +82,10 @@ control value, which must return a memory state. This is necessary for functions
to return some values, for example - the caller needs some memory state to
depend on, to ensure that it receives those return values correctly.
-The last important block kind we will mention is the `if` block. Its control
-value must be a boolean value, and it has exactly two successor blocks. The
-control flow is handed to the first successor if the bool is true, and to the
-second otherwise.
+The last important block kind we will mention is the `if` block. It has a single
+control value that must be a boolean value, and it has exactly two successor
+blocks. The control flow is handed to the first successor if the bool is true,
+and to the second otherwise.
Here is a sample if-else control flow represented with basic blocks:
diff --git a/src/cmd/compile/internal/ssa/block.go b/src/cmd/compile/internal/ssa/block.go
index 273e5f15d7..1ccea778c2 100644
--- a/src/cmd/compile/internal/ssa/block.go
+++ b/src/cmd/compile/internal/ssa/block.go
@@ -40,23 +40,28 @@ type Block struct {
// arguments by block id and have this field computed explicitly when needed?
Preds []Edge
- // A value that determines how the block is exited. Its value depends on the kind
- // of the block. For instance, a BlockIf has a boolean control value and BlockExit
- // has a memory control value.
- Control *Value
+ // A list of values that determine how the block is exited. The number
+ // and type of control values depends on the Kind of the block. For
+ // instance, a BlockIf has a single boolean control value and BlockExit
+ // has a single memory control value.
+ //
+ // The ControlValues() method may be used to get a slice with the non-nil
+ // control values that can be ranged over.
+ //
+ // Controls[1] must be nil if Controls[0] is nil.
+ Controls [2]*Value
// Auxiliary info for the block. Its value depends on the Kind.
Aux interface{}
// The unordered set of Values that define the operation of this block.
- // The list must include the control value, if any. (TODO: need this last condition?)
// After the scheduling pass, this list is ordered.
Values []*Value
// The containing function
Func *Func
- // Storage for Succs, Preds, and Values
+ // Storage for Succs, Preds and Values.
succstorage [2]Edge
predstorage [4]Edge
valstorage [9]*Value
@@ -96,12 +101,12 @@ func (e Edge) Index() int {
return e.i
}
-// kind control successors
+// kind controls successors
// ------------------------------------------
-// Exit return mem []
-// Plain nil [next]
-// If a boolean Value [then, else]
-// Defer mem [nopanic, panic] (control opcode should be OpStaticCall to runtime.deferproc)
+// Exit [return mem] []
+// Plain [] [next]
+// If [boolean Value] [then, else]
+// Defer [mem] [nopanic, panic] (control opcode should be OpStaticCall to runtime.deferproc)
type BlockKind int8
// short form print
@@ -115,8 +120,8 @@ func (b *Block) LongString() string {
if b.Aux != nil {
s += fmt.Sprintf(" %s", b.Aux)
}
- if b.Control != nil {
- s += fmt.Sprintf(" %s", b.Control)
+ for _, c := range b.ControlValues() {
+ s += fmt.Sprintf(" %s", c)
}
if len(b.Succs) > 0 {
s += " ->"
@@ -133,13 +138,76 @@ func (b *Block) LongString() string {
return s
}
+// NumControls returns the number of non-nil control values the
+// block has.
+func (b *Block) NumControls() int {
+ if b.Controls[0] == nil {
+ return 0
+ }
+ if b.Controls[1] == nil {
+ return 1
+ }
+ return 2
+}
+
+// ControlValues returns a slice containing the non-nil control
+// values of the block. The index of each control value will be
+// the same as it is in the Controls property and can be used
+// in ReplaceControl calls.
+func (b *Block) ControlValues() []*Value {
+ if b.Controls[0] == nil {
+ return b.Controls[:0]
+ }
+ if b.Controls[1] == nil {
+ return b.Controls[:1]
+ }
+ return b.Controls[:2]
+}
+
+// SetControl removes all existing control values and then adds
+// the control value provided. The number of control values after
+// a call to SetControl will always be 1.
func (b *Block) SetControl(v *Value) {
- if w := b.Control; w != nil {
- w.Uses--
+ b.ResetControls()
+ b.Controls[0] = v
+ v.Uses++
+}
+
+// ResetControls sets the number of controls for the block to 0.
+func (b *Block) ResetControls() {
+ if b.Controls[0] != nil {
+ b.Controls[0].Uses--
+ }
+ if b.Controls[1] != nil {
+ b.Controls[1].Uses--
+ }
+ b.Controls = [2]*Value{} // reset both controls to nil
+}
+
+// AddControl appends a control value to the existing list of control values.
+func (b *Block) AddControl(v *Value) {
+ i := b.NumControls()
+ b.Controls[i] = v // panics if array is full
+ v.Uses++
+}
+
+// ReplaceControl exchanges the existing control value at the index provided
+// for the new value. The index must refer to a valid control value.
+func (b *Block) ReplaceControl(i int, v *Value) {
+ b.Controls[i].Uses--
+ b.Controls[i] = v
+ v.Uses++
+}
+
+// CopyControls replaces the controls for this block with those from the
+// provided block. The provided block is not modified.
+func (b *Block) CopyControls(from *Block) {
+ if b == from {
+ return
}
- b.Control = v
- if v != nil {
- v.Uses++
+ b.ResetControls()
+ for _, c := range from.ControlValues() {
+ b.AddControl(c)
}
}
diff --git a/src/cmd/compile/internal/ssa/branchelim.go b/src/cmd/compile/internal/ssa/branchelim.go
index fda0cbb9b3..298eed362a 100644
--- a/src/cmd/compile/internal/ssa/branchelim.go
+++ b/src/cmd/compile/internal/ssa/branchelim.go
@@ -4,6 +4,8 @@
package ssa
+import "cmd/internal/src"
+
// branchelim tries to eliminate branches by
// generating CondSelect instructions.
//
@@ -160,13 +162,13 @@ func elimIf(f *Func, loadAddr *sparseSet, dom *Block) bool {
if swap {
v.Args[0], v.Args[1] = v.Args[1], v.Args[0]
}
- v.AddArg(dom.Control)
+ v.AddArg(dom.Controls[0])
}
// Put all of the instructions into 'dom'
// and update the CFG appropriately.
dom.Kind = post.Kind
- dom.SetControl(post.Control)
+ dom.CopyControls(post)
dom.Aux = post.Aux
dom.Succs = append(dom.Succs[:0], post.Succs...)
for i := range dom.Succs {
@@ -174,12 +176,98 @@ func elimIf(f *Func, loadAddr *sparseSet, dom *Block) bool {
e.b.Preds[e.i].b = dom
}
- for i := range simple.Values {
- simple.Values[i].Block = dom
+ // Try really hard to preserve statement marks attached to blocks.
+ simplePos := simple.Pos
+ postPos := post.Pos
+ simpleStmt := simplePos.IsStmt() == src.PosIsStmt
+ postStmt := postPos.IsStmt() == src.PosIsStmt
+
+ for _, v := range simple.Values {
+ v.Block = dom
}
- for i := range post.Values {
- post.Values[i].Block = dom
+ for _, v := range post.Values {
+ v.Block = dom
}
+
+ // findBlockPos determines if b contains a stmt-marked value
+ // that has the same line number as the Pos for b itself.
+ // (i.e. is the position on b actually redundant?)
+ findBlockPos := func(b *Block) bool {
+ pos := b.Pos
+ for _, v := range b.Values {
+ // See if there is a stmt-marked value already that matches simple.Pos (and perhaps post.Pos)
+ if pos.SameFileAndLine(v.Pos) && v.Pos.IsStmt() == src.PosIsStmt {
+ return true
+ }
+ }
+ return false
+ }
+ if simpleStmt {
+ simpleStmt = !findBlockPos(simple)
+ if !simpleStmt && simplePos.SameFileAndLine(postPos) {
+ postStmt = false
+ }
+
+ }
+ if postStmt {
+ postStmt = !findBlockPos(post)
+ }
+
+ // If simpleStmt and/or postStmt are still true, then try harder
+ // to find the corresponding statement marks new homes.
+
+ // setBlockPos determines if b contains a can-be-statement value
+ // that has the same line number as the Pos for b itself, and
+ // puts a statement mark on it, and returns whether it succeeded
+ // in this operation.
+ setBlockPos := func (b *Block) bool {
+ pos := b.Pos
+ for _, v := range b.Values {
+ if pos.SameFileAndLine(v.Pos) && !isPoorStatementOp(v.Op) {
+ v.Pos = v.Pos.WithIsStmt()
+ return true
+ }
+ }
+ return false
+ }
+ // If necessary and possible, add a mark to a value in simple
+ if simpleStmt {
+ if setBlockPos(simple) && simplePos.SameFileAndLine(postPos) {
+ postStmt = false
+ }
+ }
+ // If necessary and possible, add a mark to a value in post
+ if postStmt {
+ postStmt = !setBlockPos(post)
+ }
+
+ // Before giving up (this was added because it helps), try the end of "dom", and if that is not available,
+ // try the values in the successor block if it is uncomplicated.
+ if postStmt {
+ if dom.Pos.IsStmt() != src.PosIsStmt {
+ dom.Pos = postPos
+ } else {
+ // Try the successor block
+ if len(dom.Succs) == 1 && len(dom.Succs[0].Block().Preds) == 1 {
+ succ := dom.Succs[0].Block()
+ for _, v := range succ.Values {
+ if isPoorStatementOp(v.Op) {
+ continue
+ }
+ if postPos.SameFileAndLine(v.Pos) {
+ v.Pos = v.Pos.WithIsStmt()
+ }
+ postStmt = false
+ break
+ }
+ // If postStmt still true, tag the block itself if possible
+ if postStmt && succ.Pos.IsStmt() != src.PosIsStmt {
+ succ.Pos = postPos
+ }
+ }
+ }
+ }
+
dom.Values = append(dom.Values, simple.Values...)
dom.Values = append(dom.Values, post.Values...)
@@ -201,7 +289,7 @@ func clobberBlock(b *Block) {
b.Preds = nil
b.Succs = nil
b.Aux = nil
- b.SetControl(nil)
+ b.ResetControls()
b.Likely = BranchUnknown
b.Kind = BlockInvalid
}
@@ -259,13 +347,13 @@ func elimIfElse(f *Func, loadAddr *sparseSet, b *Block) bool {
if swap {
v.Args[0], v.Args[1] = v.Args[1], v.Args[0]
}
- v.AddArg(b.Control)
+ v.AddArg(b.Controls[0])
}
// Move the contents of all of these
// blocks into 'b' and update CFG edges accordingly
b.Kind = post.Kind
- b.SetControl(post.Control)
+ b.CopyControls(post)
b.Aux = post.Aux
b.Succs = append(b.Succs[:0], post.Succs...)
for i := range b.Succs {
diff --git a/src/cmd/compile/internal/ssa/check.go b/src/cmd/compile/internal/ssa/check.go
index 6dbe2ac0b6..e97377bf5c 100644
--- a/src/cmd/compile/internal/ssa/check.go
+++ b/src/cmd/compile/internal/ssa/check.go
@@ -39,31 +39,31 @@ func checkFunc(f *Func) {
if len(b.Succs) != 0 {
f.Fatalf("exit block %s has successors", b)
}
- if b.Control == nil {
+ if b.NumControls() != 1 {
f.Fatalf("exit block %s has no control value", b)
}
- if !b.Control.Type.IsMemory() {
- f.Fatalf("exit block %s has non-memory control value %s", b, b.Control.LongString())
+ if !b.Controls[0].Type.IsMemory() {
+ f.Fatalf("exit block %s has non-memory control value %s", b, b.Controls[0].LongString())
}
case BlockRet:
if len(b.Succs) != 0 {
f.Fatalf("ret block %s has successors", b)
}
- if b.Control == nil {
+ if b.NumControls() != 1 {
f.Fatalf("ret block %s has nil control", b)
}
- if !b.Control.Type.IsMemory() {
- f.Fatalf("ret block %s has non-memory control value %s", b, b.Control.LongString())
+ if !b.Controls[0].Type.IsMemory() {
+ f.Fatalf("ret block %s has non-memory control value %s", b, b.Controls[0].LongString())
}
case BlockRetJmp:
if len(b.Succs) != 0 {
f.Fatalf("retjmp block %s len(Succs)==%d, want 0", b, len(b.Succs))
}
- if b.Control == nil {
+ if b.NumControls() != 1 {
f.Fatalf("retjmp block %s has nil control", b)
}
- if !b.Control.Type.IsMemory() {
- f.Fatalf("retjmp block %s has non-memory control value %s", b, b.Control.LongString())
+ if !b.Controls[0].Type.IsMemory() {
+ f.Fatalf("retjmp block %s has non-memory control value %s", b, b.Controls[0].LongString())
}
if b.Aux == nil {
f.Fatalf("retjmp block %s has nil Aux field", b)
@@ -72,34 +72,34 @@ func checkFunc(f *Func) {
if len(b.Succs) != 1 {
f.Fatalf("plain block %s len(Succs)==%d, want 1", b, len(b.Succs))
}
- if b.Control != nil {
- f.Fatalf("plain block %s has non-nil control %s", b, b.Control.LongString())
+ if b.NumControls() != 0 {
+ f.Fatalf("plain block %s has non-nil control %s", b, b.Controls[0].LongString())
}
case BlockIf:
if len(b.Succs) != 2 {
f.Fatalf("if block %s len(Succs)==%d, want 2", b, len(b.Succs))
}
- if b.Control == nil {
+ if b.NumControls() != 1 {
f.Fatalf("if block %s has no control value", b)
}
- if !b.Control.Type.IsBoolean() {
- f.Fatalf("if block %s has non-bool control value %s", b, b.Control.LongString())
+ if !b.Controls[0].Type.IsBoolean() {
+ f.Fatalf("if block %s has non-bool control value %s", b, b.Controls[0].LongString())
}
case BlockDefer:
if len(b.Succs) != 2 {
f.Fatalf("defer block %s len(Succs)==%d, want 2", b, len(b.Succs))
}
- if b.Control == nil {
+ if b.NumControls() != 1 {
f.Fatalf("defer block %s has no control value", b)
}
- if !b.Control.Type.IsMemory() {
- f.Fatalf("defer block %s has non-memory control value %s", b, b.Control.LongString())
+ if !b.Controls[0].Type.IsMemory() {
+ f.Fatalf("defer block %s has non-memory control value %s", b, b.Controls[0].LongString())
}
case BlockFirst:
if len(b.Succs) != 2 {
f.Fatalf("plain/dead block %s len(Succs)==%d, want 2", b, len(b.Succs))
}
- if b.Control != nil {
+ if b.NumControls() != 0 {
f.Fatalf("plain/dead block %s has a control value", b)
}
}
@@ -263,8 +263,10 @@ func checkFunc(f *Func) {
}
}
}
- if b.Control != nil && !valueMark[b.Control.ID] {
- f.Fatalf("control value for %s is missing: %v", b, b.Control)
+ for _, c := range b.ControlValues() {
+ if !valueMark[c.ID] {
+ f.Fatalf("control value for %s is missing: %v", b, c)
+ }
}
}
for b := f.freeBlocks; b != nil; b = b.succstorage[0].b {
@@ -296,8 +298,10 @@ func checkFunc(f *Func) {
}
}
}
- if b.Control != nil && !domCheck(f, sdom, b.Control.Block, b) {
- f.Fatalf("control value %s for %s doesn't dominate", b.Control, b)
+ for _, c := range b.ControlValues() {
+ if !domCheck(f, sdom, c.Block, b) {
+ f.Fatalf("control value %s for %s doesn't dominate", c, b)
+ }
}
}
}
@@ -329,8 +333,8 @@ func checkFunc(f *Func) {
uses[a.ID]++
}
}
- if b.Control != nil {
- uses[b.Control.ID]++
+ for _, c := range b.ControlValues() {
+ uses[c.ID]++
}
}
for _, b := range f.Blocks {
diff --git a/src/cmd/compile/internal/ssa/compile.go b/src/cmd/compile/internal/ssa/compile.go
index f061b62448..1a0a46c154 100644
--- a/src/cmd/compile/internal/ssa/compile.go
+++ b/src/cmd/compile/internal/ssa/compile.go
@@ -409,6 +409,7 @@ var passes = [...]pass{
{name: "opt deadcode", fn: deadcode, required: true}, // remove any blocks orphaned during opt
{name: "generic cse", fn: cse},
{name: "phiopt", fn: phiopt},
+ {name: "gcse deadcode", fn: deadcode, required: true}, // clean out after cse and phiopt
{name: "nilcheckelim", fn: nilcheckelim},
{name: "prove", fn: prove},
{name: "fuse plain", fn: fusePlain},
diff --git a/src/cmd/compile/internal/ssa/copyelim.go b/src/cmd/compile/internal/ssa/copyelim.go
index 44ccfe1bfe..5954d3bec8 100644
--- a/src/cmd/compile/internal/ssa/copyelim.go
+++ b/src/cmd/compile/internal/ssa/copyelim.go
@@ -17,8 +17,10 @@ func copyelim(f *Func) {
// Update block control values.
for _, b := range f.Blocks {
- if v := b.Control; v != nil && v.Op == OpCopy {
- b.SetControl(v.Args[0])
+ for i, v := range b.ControlValues() {
+ if v.Op == OpCopy {
+ b.ReplaceControl(i, v.Args[0])
+ }
}
}
diff --git a/src/cmd/compile/internal/ssa/cse.go b/src/cmd/compile/internal/ssa/cse.go
index 75595c3b3d..1fdcffcae8 100644
--- a/src/cmd/compile/internal/ssa/cse.go
+++ b/src/cmd/compile/internal/ssa/cse.go
@@ -248,14 +248,14 @@ func cse(f *Func) {
}
}
}
- if v := b.Control; v != nil {
+ for i, v := range b.ControlValues() {
if x := rewrite[v.ID]; x != nil {
if v.Op == OpNilCheck {
// nilcheck pass will remove the nil checks and log
// them appropriately, so don't mess with them here.
continue
}
- b.SetControl(x)
+ b.ReplaceControl(i, x)
}
}
}
diff --git a/src/cmd/compile/internal/ssa/deadcode.go b/src/cmd/compile/internal/ssa/deadcode.go
index 24d1d88165..b79ec7c2f6 100644
--- a/src/cmd/compile/internal/ssa/deadcode.go
+++ b/src/cmd/compile/internal/ssa/deadcode.go
@@ -110,11 +110,13 @@ func liveValues(f *Func, reachable []bool) (live []bool, liveOrderStmts []*Value
if !reachable[b.ID] {
continue
}
- if v := b.Control; v != nil && !live[v.ID] {
- live[v.ID] = true
- q = append(q, v)
- if v.Pos.IsStmt() != src.PosNotStmt {
- liveOrderStmts = append(liveOrderStmts, v)
+ for _, v := range b.ControlValues() {
+ if !live[v.ID] {
+ live[v.ID] = true
+ q = append(q, v)
+ if v.Pos.IsStmt() != src.PosNotStmt {
+ liveOrderStmts = append(liveOrderStmts, v)
+ }
}
}
for _, v := range b.Values {
@@ -252,7 +254,7 @@ func deadcode(f *Func) {
for i, b := range f.Blocks {
if !reachable[b.ID] {
// TODO what if control is statement boundary? Too late here.
- b.SetControl(nil)
+ b.ResetControls()
}
for _, v := range b.Values {
if !live[v.ID] {
diff --git a/src/cmd/compile/internal/ssa/deadstore.go b/src/cmd/compile/internal/ssa/deadstore.go
index ebcb571e66..6b9bcedadb 100644
--- a/src/cmd/compile/internal/ssa/deadstore.go
+++ b/src/cmd/compile/internal/ssa/deadstore.go
@@ -264,12 +264,11 @@ func elimDeadAutosGeneric(f *Func) {
changed = visit(v) || changed
}
// keep the auto if its address reaches a control value
- if b.Control == nil {
- continue
- }
- if n, ok := addr[b.Control]; ok && !used[n] {
- used[n] = true
- changed = true
+ for _, c := range b.ControlValues() {
+ if n, ok := addr[c]; ok && !used[n] {
+ used[n] = true
+ changed = true
+ }
}
}
if !changed {
diff --git a/src/cmd/compile/internal/ssa/flagalloc.go b/src/cmd/compile/internal/ssa/flagalloc.go
index 7a2ecc22dc..7e7ce11482 100644
--- a/src/cmd/compile/internal/ssa/flagalloc.go
+++ b/src/cmd/compile/internal/ssa/flagalloc.go
@@ -18,9 +18,17 @@ func flagalloc(f *Func) {
// Walk values backwards to figure out what flag
// value we want in the flag register at the start
// of the block.
- flag := end[b.ID]
- if b.Control != nil && b.Control.Type.IsFlags() {
- flag = b.Control
+ var flag *Value
+ for _, c := range b.ControlValues() {
+ if c.Type.IsFlags() {
+ if flag != nil {
+ panic("cannot have multiple controls using flags")
+ }
+ flag = c
+ }
+ }
+ if flag == nil {
+ flag = end[b.ID]
}
for j := len(b.Values) - 1; j >= 0; j-- {
v := b.Values[j]
@@ -49,13 +57,15 @@ func flagalloc(f *Func) {
// we can leave in the flags register at the end of the block. (There
// is no place to put a flag regeneration instruction.)
for _, b := range f.Blocks {
- v := b.Control
- if v != nil && v.Type.IsFlags() && end[b.ID] != v {
- end[b.ID] = nil
- }
if b.Kind == BlockDefer {
// Defer blocks internally use/clobber the flags value.
end[b.ID] = nil
+ continue
+ }
+ for _, v := range b.ControlValues() {
+ if v.Type.IsFlags() && end[b.ID] != v {
+ end[b.ID] = nil
+ }
}
}
@@ -85,8 +95,10 @@ func flagalloc(f *Func) {
flag = v
}
}
- if v := b.Control; v != nil && v != flag && v.Type.IsFlags() {
- spill[v.ID] = true
+ for _, v := range b.ControlValues() {
+ if v != flag && v.Type.IsFlags() {
+ spill[v.ID] = true
+ }
}
if v := end[b.ID]; v != nil && v != flag {
spill[v.ID] = true
@@ -149,11 +161,13 @@ func flagalloc(f *Func) {
flag = v
}
}
- if v := b.Control; v != nil && v != flag && v.Type.IsFlags() {
- // Recalculate control value.
- c := copyFlags(v, b)
- b.SetControl(c)
- flag = v
+ for i, v := range b.ControlValues() {
+ if v != flag && v.Type.IsFlags() {
+ // Recalculate control value.
+ c := copyFlags(v, b)
+ b.ReplaceControl(i, c)
+ flag = v
+ }
}
if v := end[b.ID]; v != nil && v != flag {
// Need to reissue flag generator for use by
diff --git a/src/cmd/compile/internal/ssa/fuse.go b/src/cmd/compile/internal/ssa/fuse.go
index 8d14b5d696..a530874b80 100644
--- a/src/cmd/compile/internal/ssa/fuse.go
+++ b/src/cmd/compile/internal/ssa/fuse.go
@@ -118,7 +118,7 @@ func fuseBlockIf(b *Block) bool {
}
b.Kind = BlockPlain
b.Likely = BranchUnknown
- b.SetControl(nil)
+ b.ResetControls()
// Trash the empty blocks s0 and s1.
blocks := [...]*Block{s0, s1}
diff --git a/src/cmd/compile/internal/ssa/gen/386.rules b/src/cmd/compile/internal/ssa/gen/386.rules
index 1cdcf4c710..94573702a5 100644
--- a/src/cmd/compile/internal/ssa/gen/386.rules
+++ b/src/cmd/compile/internal/ssa/gen/386.rules
@@ -899,65 +899,65 @@
(SBBLcarrymask (FlagGT_UGT)) -> (MOVLconst [0])
// Absorb flag constants into branches.
-(EQ (FlagEQ) yes no) -> (First nil yes no)
-(EQ (FlagLT_ULT) yes no) -> (First nil no yes)
-(EQ (FlagLT_UGT) yes no) -> (First nil no yes)
-(EQ (FlagGT_ULT) yes no) -> (First nil no yes)
-(EQ (FlagGT_UGT) yes no) -> (First nil no yes)
+(EQ (FlagEQ) yes no) -> (First yes no)
+(EQ (FlagLT_ULT) yes no) -> (First no yes)
+(EQ (FlagLT_UGT) yes no) -> (First no yes)
+(EQ (FlagGT_ULT) yes no) -> (First no yes)
+(EQ (FlagGT_UGT) yes no) -> (First no yes)
-(NE (FlagEQ) yes no) -> (First nil no yes)
-(NE (FlagLT_ULT) yes no) -> (First nil yes no)
-(NE (FlagLT_UGT) yes no) -> (First nil yes no)
-(NE (FlagGT_ULT) yes no) -> (First nil yes no)
-(NE (FlagGT_UGT) yes no) -> (First nil yes no)
+(NE (FlagEQ) yes no) -> (First no yes)
+(NE (FlagLT_ULT) yes no) -> (First yes no)
+(NE (FlagLT_UGT) yes no) -> (First yes no)
+(NE (FlagGT_ULT) yes no) -> (First yes no)
+(NE (FlagGT_UGT) yes no) -> (First yes no)
-(LT (FlagEQ) yes no) -> (First nil no yes)
-(LT (FlagLT_ULT) yes no) -> (First nil yes no)
-(LT (FlagLT_UGT) yes no) -> (First nil yes no)
-(LT (FlagGT_ULT) yes no) -> (First nil no yes)
-(LT (FlagGT_UGT) yes no) -> (First nil no yes)
+(LT (FlagEQ) yes no) -> (First no yes)
+(LT (FlagLT_ULT) yes no) -> (First yes no)
+(LT (FlagLT_UGT) yes no) -> (First yes no)
+(LT (FlagGT_ULT) yes no) -> (First no yes)
+(LT (FlagGT_UGT) yes no) -> (First no yes)
-(LE (FlagEQ) yes no) -> (First nil yes no)
-(LE (FlagLT_ULT) yes no) -> (First nil yes no)
-(LE (FlagLT_UGT) yes no) -> (First nil yes no)
-(LE (FlagGT_ULT) yes no) -> (First nil no yes)
-(LE (FlagGT_UGT) yes no) -> (First nil no yes)
+(LE (FlagEQ) yes no) -> (First yes no)
+(LE (FlagLT_ULT) yes no) -> (First yes no)
+(LE (FlagLT_UGT) yes no) -> (First yes no)
+(LE (FlagGT_ULT) yes no) -> (First no yes)
+(LE (FlagGT_UGT) yes no) -> (First no yes)
-(GT (FlagEQ) yes no) -> (First nil no yes)
-(GT (FlagLT_ULT) yes no) -> (First nil no yes)
-(GT (FlagLT_UGT) yes no) -> (First nil no yes)
-(GT (FlagGT_ULT) yes no) -> (First nil yes no)
-(GT (FlagGT_UGT) yes no) -> (First nil yes no)
+(GT (FlagEQ) yes no) -> (First no yes)
+(GT (FlagLT_ULT) yes no) -> (First no yes)
+(GT (FlagLT_UGT) yes no) -> (First no yes)
+(GT (FlagGT_ULT) yes no) -> (First yes no)
+(GT (FlagGT_UGT) yes no) -> (First yes no)
-(GE (FlagEQ) yes no) -> (First nil yes no)
-(GE (FlagLT_ULT) yes no) -> (First nil no yes)
-(GE (FlagLT_UGT) yes no) -> (First nil no yes)
-(GE (FlagGT_ULT) yes no) -> (First nil yes no)
-(GE (FlagGT_UGT) yes no) -> (First nil yes no)
+(GE (FlagEQ) yes no) -> (First yes no)
+(GE (FlagLT_ULT) yes no) -> (First no yes)
+(GE (FlagLT_UGT) yes no) -> (First no yes)
+(GE (FlagGT_ULT) yes no) -> (First yes no)
+(GE (FlagGT_UGT) yes no) -> (First yes no)
-(ULT (FlagEQ) yes no) -> (First nil no yes)
-(ULT (FlagLT_ULT) yes no) -> (First nil yes no)
-(ULT (FlagLT_UGT) yes no) -> (First nil no yes)
-(ULT (FlagGT_ULT) yes no) -> (First nil yes no)
-(ULT (FlagGT_UGT) yes no) -> (First nil no yes)
+(ULT (FlagEQ) yes no) -> (First no yes)
+(ULT (FlagLT_ULT) yes no) -> (First yes no)
+(ULT (FlagLT_UGT) yes no) -> (First no yes)
+(ULT (FlagGT_ULT) yes no) -> (First yes no)
+(ULT (FlagGT_UGT) yes no) -> (First no yes)
-(ULE (FlagEQ) yes no) -> (First nil yes no)
-(ULE (FlagLT_ULT) yes no) -> (First nil yes no)
-(ULE (FlagLT_UGT) yes no) -> (First nil no yes)
-(ULE (FlagGT_ULT) yes no) -> (First nil yes no)
-(ULE (FlagGT_UGT) yes no) -> (First nil no yes)
+(ULE (FlagEQ) yes no) -> (First yes no)
+(ULE (FlagLT_ULT) yes no) -> (First yes no)
+(ULE (FlagLT_UGT) yes no) -> (First no yes)
+(ULE (FlagGT_ULT) yes no) -> (First yes no)
+(ULE (FlagGT_UGT) yes no) -> (First no yes)
-(UGT (FlagEQ) yes no) -> (First nil no yes)
-(UGT (FlagLT_ULT) yes no) -> (First nil no yes)
-(UGT (FlagLT_UGT) yes no) -> (First nil yes no)
-(UGT (FlagGT_ULT) yes no) -> (First nil no yes)
-(UGT (FlagGT_UGT) yes no) -> (First nil yes no)
+(UGT (FlagEQ) yes no) -> (First no yes)
+(UGT (FlagLT_ULT) yes no) -> (First no yes)
+(UGT (FlagLT_UGT) yes no) -> (First yes no)
+(UGT (FlagGT_ULT) yes no) -> (First no yes)
+(UGT (FlagGT_UGT) yes no) -> (First yes no)
-(UGE (FlagEQ) yes no) -> (First nil yes no)
-(UGE (FlagLT_ULT) yes no) -> (First nil no yes)
-(UGE (FlagLT_UGT) yes no) -> (First nil yes no)
-(UGE (FlagGT_ULT) yes no) -> (First nil no yes)
-(UGE (FlagGT_UGT) yes no) -> (First nil yes no)
+(UGE (FlagEQ) yes no) -> (First yes no)
+(UGE (FlagLT_ULT) yes no) -> (First no yes)
+(UGE (FlagLT_UGT) yes no) -> (First yes no)
+(UGE (FlagGT_ULT) yes no) -> (First no yes)
+(UGE (FlagGT_UGT) yes no) -> (First yes no)
// Absorb flag constants into SETxx ops.
(SETEQ (FlagEQ)) -> (MOVLconst [1])
diff --git a/src/cmd/compile/internal/ssa/gen/386Ops.go b/src/cmd/compile/internal/ssa/gen/386Ops.go
index 2851c4321c..4fb61adfeb 100644
--- a/src/cmd/compile/internal/ssa/gen/386Ops.go
+++ b/src/cmd/compile/internal/ssa/gen/386Ops.go
@@ -564,22 +564,22 @@ func init() {
}
var _386blocks = []blockData{
- {name: "EQ"},
- {name: "NE"},
- {name: "LT"},
- {name: "LE"},
- {name: "GT"},
- {name: "GE"},
- {name: "OS"},
- {name: "OC"},
- {name: "ULT"},
- {name: "ULE"},
- {name: "UGT"},
- {name: "UGE"},
- {name: "EQF"},
- {name: "NEF"},
- {name: "ORD"}, // FP, ordered comparison (parity zero)
- {name: "NAN"}, // FP, unordered comparison (parity one)
+ {name: "EQ", controls: 1},
+ {name: "NE", controls: 1},
+ {name: "LT", controls: 1},
+ {name: "LE", controls: 1},
+ {name: "GT", controls: 1},
+ {name: "GE", controls: 1},
+ {name: "OS", controls: 1},
+ {name: "OC", controls: 1},
+ {name: "ULT", controls: 1},
+ {name: "ULE", controls: 1},
+ {name: "UGT", controls: 1},
+ {name: "UGE", controls: 1},
+ {name: "EQF", controls: 1},
+ {name: "NEF", controls: 1},
+ {name: "ORD", controls: 1}, // FP, ordered comparison (parity zero)
+ {name: "NAN", controls: 1}, // FP, unordered comparison (parity one)
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/AMD64.rules b/src/cmd/compile/internal/ssa/gen/AMD64.rules
index 58e2d3ad18..e4b97a8763 100644
--- a/src/cmd/compile/internal/ssa/gen/AMD64.rules
+++ b/src/cmd/compile/internal/ssa/gen/AMD64.rules
@@ -1346,16 +1346,16 @@
(SBBLcarrymask (FlagGT_UGT)) -> (MOVLconst [0])
// Absorb flag constants into branches.
-((EQ|LE|GE|ULE|UGE) (FlagEQ) yes no) -> (First nil yes no)
-((NE|LT|GT|ULT|UGT) (FlagEQ) yes no) -> (First nil no yes)
-((NE|LT|LE|ULT|ULE) (FlagLT_ULT) yes no) -> (First nil yes no)
-((EQ|GT|GE|UGT|UGE) (FlagLT_ULT) yes no) -> (First nil no yes)
-((NE|LT|LE|UGT|UGE) (FlagLT_UGT) yes no) -> (First nil yes no)
-((EQ|GT|GE|ULT|ULE) (FlagLT_UGT) yes no) -> (First nil no yes)
-((NE|GT|GE|ULT|ULE) (FlagGT_ULT) yes no) -> (First nil yes no)
-((EQ|LT|LE|UGT|UGE) (FlagGT_ULT) yes no) -> (First nil no yes)
-((NE|GT|GE|UGT|UGE) (FlagGT_UGT) yes no) -> (First nil yes no)
-((EQ|LT|LE|ULT|ULE) (FlagGT_UGT) yes no) -> (First nil no yes)
+((EQ|LE|GE|ULE|UGE) (FlagEQ) yes no) -> (First yes no)
+((NE|LT|GT|ULT|UGT) (FlagEQ) yes no) -> (First no yes)
+((NE|LT|LE|ULT|ULE) (FlagLT_ULT) yes no) -> (First yes no)
+((EQ|GT|GE|UGT|UGE) (FlagLT_ULT) yes no) -> (First no yes)
+((NE|LT|LE|UGT|UGE) (FlagLT_UGT) yes no) -> (First yes no)
+((EQ|GT|GE|ULT|ULE) (FlagLT_UGT) yes no) -> (First no yes)
+((NE|GT|GE|ULT|ULE) (FlagGT_ULT) yes no) -> (First yes no)
+((EQ|LT|LE|UGT|UGE) (FlagGT_ULT) yes no) -> (First no yes)
+((NE|GT|GE|UGT|UGE) (FlagGT_UGT) yes no) -> (First yes no)
+((EQ|LT|LE|ULT|ULE) (FlagGT_UGT) yes no) -> (First no yes)
// Absorb flag constants into SETxx ops.
((SETEQ|SETLE|SETGE|SETBE|SETAE) (FlagEQ)) -> (MOVLconst [1])
diff --git a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go
index 739733cf16..ed58db4d59 100644
--- a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go
+++ b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go
@@ -788,22 +788,22 @@ func init() {
}
var AMD64blocks = []blockData{
- {name: "EQ"},
- {name: "NE"},
- {name: "LT"},
- {name: "LE"},
- {name: "GT"},
- {name: "GE"},
- {name: "OS"},
- {name: "OC"},
- {name: "ULT"},
- {name: "ULE"},
- {name: "UGT"},
- {name: "UGE"},
- {name: "EQF"},
- {name: "NEF"},
- {name: "ORD"}, // FP, ordered comparison (parity zero)
- {name: "NAN"}, // FP, unordered comparison (parity one)
+ {name: "EQ", controls: 1},
+ {name: "NE", controls: 1},
+ {name: "LT", controls: 1},
+ {name: "LE", controls: 1},
+ {name: "GT", controls: 1},
+ {name: "GE", controls: 1},
+ {name: "OS", controls: 1},
+ {name: "OC", controls: 1},
+ {name: "ULT", controls: 1},
+ {name: "ULE", controls: 1},
+ {name: "UGT", controls: 1},
+ {name: "UGE", controls: 1},
+ {name: "EQF", controls: 1},
+ {name: "NEF", controls: 1},
+ {name: "ORD", controls: 1}, // FP, ordered comparison (parity zero)
+ {name: "NAN", controls: 1}, // FP, unordered comparison (parity one)
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/ARM.rules b/src/cmd/compile/internal/ssa/gen/ARM.rules
index a3ee9046c5..0858b443da 100644
--- a/src/cmd/compile/internal/ssa/gen/ARM.rules
+++ b/src/cmd/compile/internal/ssa/gen/ARM.rules
@@ -647,65 +647,65 @@
(CMPconst (SRLconst _ [c]) [n]) && 0 <= n && 0 < c && c <= 32 && (1<<uint32(32-c)) <= uint32(n) -> (FlagLT_ULT)
// absorb flag constants into branches
-(EQ (FlagEQ) yes no) -> (First nil yes no)
-(EQ (FlagLT_ULT) yes no) -> (First nil no yes)
-(EQ (FlagLT_UGT) yes no) -> (First nil no yes)
-(EQ (FlagGT_ULT) yes no) -> (First nil no yes)
-(EQ (FlagGT_UGT) yes no) -> (First nil no yes)
+(EQ (FlagEQ) yes no) -> (First yes no)
+(EQ (FlagLT_ULT) yes no) -> (First no yes)
+(EQ (FlagLT_UGT) yes no) -> (First no yes)
+(EQ (FlagGT_ULT) yes no) -> (First no yes)
+(EQ (FlagGT_UGT) yes no) -> (First no yes)
-(NE (FlagEQ) yes no) -> (First nil no yes)
-(NE (FlagLT_ULT) yes no) -> (First nil yes no)
-(NE (FlagLT_UGT) yes no) -> (First nil yes no)
-(NE (FlagGT_ULT) yes no) -> (First nil yes no)
-(NE (FlagGT_UGT) yes no) -> (First nil yes no)
+(NE (FlagEQ) yes no) -> (First no yes)
+(NE (FlagLT_ULT) yes no) -> (First yes no)
+(NE (FlagLT_UGT) yes no) -> (First yes no)
+(NE (FlagGT_ULT) yes no) -> (First yes no)
+(NE (FlagGT_UGT) yes no) -> (First yes no)
-(LT (FlagEQ) yes no) -> (First nil no yes)
-(LT (FlagLT_ULT) yes no) -> (First nil yes no)
-(LT (FlagLT_UGT) yes no) -> (First nil yes no)
-(LT (FlagGT_ULT) yes no) -> (First nil no yes)
-(LT (FlagGT_UGT) yes no) -> (First nil no yes)
+(LT (FlagEQ) yes no) -> (First no yes)
+(LT (FlagLT_ULT) yes no) -> (First yes no)
+(LT (FlagLT_UGT) yes no) -> (First yes no)
+(LT (FlagGT_ULT) yes no) -> (First no yes)
+(LT (FlagGT_UGT) yes no) -> (First no yes)
-(LE (FlagEQ) yes no) -> (First nil yes no)
-(LE (FlagLT_ULT) yes no) -> (First nil yes no)
-(LE (FlagLT_UGT) yes no) -> (First nil yes no)
-(LE (FlagGT_ULT) yes no) -> (First nil no yes)
-(LE (FlagGT_UGT) yes no) -> (First nil no yes)
+(LE (FlagEQ) yes no) -> (First yes no)
+(LE (FlagLT_ULT) yes no) -> (First yes no)
+(LE (FlagLT_UGT) yes no) -> (First yes no)
+(LE (FlagGT_ULT) yes no) -> (First no yes)
+(LE (FlagGT_UGT) yes no) -> (First no yes)
-(GT (FlagEQ) yes no) -> (First nil no yes)
-(GT (FlagLT_ULT) yes no) -> (First nil no yes)
-(GT (FlagLT_UGT) yes no) -> (First nil no yes)
-(GT (FlagGT_ULT) yes no) -> (First nil yes no)
-(GT (FlagGT_UGT) yes no) -> (First nil yes no)
+(GT (FlagEQ) yes no) -> (First no yes)
+(GT (FlagLT_ULT) yes no) -> (First no yes)
+(GT (FlagLT_UGT) yes no) -> (First no yes)
+(GT (FlagGT_ULT) yes no) -> (First yes no)
+(GT (FlagGT_UGT) yes no) -> (First yes no)
-(GE (FlagEQ) yes no) -> (First nil yes no)
-(GE (FlagLT_ULT) yes no) -> (First nil no yes)
-(GE (FlagLT_UGT) yes no) -> (First nil no yes)
-(GE (FlagGT_ULT) yes no) -> (First nil yes no)
-(GE (FlagGT_UGT) yes no) -> (First nil yes no)
+(GE (FlagEQ) yes no) -> (First yes no)
+(GE (FlagLT_ULT) yes no) -> (First no yes)
+(GE (FlagLT_UGT) yes no) -> (First no yes)
+(GE (FlagGT_ULT) yes no) -> (First yes no)
+(GE (FlagGT_UGT) yes no) -> (First yes no)
-(ULT (FlagEQ) yes no) -> (First nil no yes)
-(ULT (FlagLT_ULT) yes no) -> (First nil yes no)
-(ULT (FlagLT_UGT) yes no) -> (First nil no yes)
-(ULT (FlagGT_ULT) yes no) -> (First nil yes no)
-(ULT (FlagGT_UGT) yes no) -> (First nil no yes)
+(ULT (FlagEQ) yes no) -> (First no yes)
+(ULT (FlagLT_ULT) yes no) -> (First yes no)
+(ULT (FlagLT_UGT) yes no) -> (First no yes)
+(ULT (FlagGT_ULT) yes no) -> (First yes no)
+(ULT (FlagGT_UGT) yes no) -> (First no yes)
-(ULE (FlagEQ) yes no) -> (First nil yes no)
-(ULE (FlagLT_ULT) yes no) -> (First nil yes no)
-(ULE (FlagLT_UGT) yes no) -> (First nil no yes)
-(ULE (FlagGT_ULT) yes no) -> (First nil yes no)
-(ULE (FlagGT_UGT) yes no) -> (First nil no yes)
+(ULE (FlagEQ) yes no) -> (First yes no)
+(ULE (FlagLT_ULT) yes no) -> (First yes no)
+(ULE (FlagLT_UGT) yes no) -> (First no yes)
+(ULE (FlagGT_ULT) yes no) -> (First yes no)
+(ULE (FlagGT_UGT) yes no) -> (First no yes)
-(UGT (FlagEQ) yes no) -> (First nil no yes)
-(UGT (FlagLT_ULT) yes no) -> (First nil no yes)
-(UGT (FlagLT_UGT) yes no) -> (First nil yes no)
-(UGT (FlagGT_ULT) yes no) -> (First nil no yes)
-(UGT (FlagGT_UGT) yes no) -> (First nil yes no)
+(UGT (FlagEQ) yes no) -> (First no yes)
+(UGT (FlagLT_ULT) yes no) -> (First no yes)
+(UGT (FlagLT_UGT) yes no) -> (First yes no)
+(UGT (FlagGT_ULT) yes no) -> (First no yes)
+(UGT (FlagGT_UGT) yes no) -> (First yes no)
-(UGE (FlagEQ) yes no) -> (First nil yes no)
-(UGE (FlagLT_ULT) yes no) -> (First nil no yes)
-(UGE (FlagLT_UGT) yes no) -> (First nil yes no)
-(UGE (FlagGT_ULT) yes no) -> (First nil no yes)
-(UGE (FlagGT_UGT) yes no) -> (First nil yes no)
+(UGE (FlagEQ) yes no) -> (First yes no)
+(UGE (FlagLT_ULT) yes no) -> (First no yes)
+(UGE (FlagLT_UGT) yes no) -> (First yes no)
+(UGE (FlagGT_ULT) yes no) -> (First no yes)
+(UGE (FlagGT_UGT) yes no) -> (First yes no)
// absorb InvertFlags into branches
(LT (InvertFlags cmp) yes no) -> (GT cmp yes no)
diff --git a/src/cmd/compile/internal/ssa/gen/ARM64.rules b/src/cmd/compile/internal/ssa/gen/ARM64.rules
index ddb504531c..7edd19e9cc 100644
--- a/src/cmd/compile/internal/ssa/gen/ARM64.rules
+++ b/src/cmd/compile/internal/ssa/gen/ARM64.rules
@@ -1481,74 +1481,74 @@
(CMPWconst (MOVHUreg _) [c]) && 0xffff < int32(c) -> (FlagLT_ULT)
// absorb flag constants into branches
-(EQ (FlagEQ) yes no) -> (First nil yes no)
-(EQ (FlagLT_ULT) yes no) -> (First nil no yes)
-(EQ (FlagLT_UGT) yes no) -> (First nil no yes)
-(EQ (FlagGT_ULT) yes no) -> (First nil no yes)
-(EQ (FlagGT_UGT) yes no) -> (First nil no yes)
+(EQ (FlagEQ) yes no) -> (First yes no)
+(EQ (FlagLT_ULT) yes no) -> (First no yes)
+(EQ (FlagLT_UGT) yes no) -> (First no yes)
+(EQ (FlagGT_ULT) yes no) -> (First no yes)
+(EQ (FlagGT_UGT) yes no) -> (First no yes)
-(NE (FlagEQ) yes no) -> (First nil no yes)
-(NE (FlagLT_ULT) yes no) -> (First nil yes no)
-(NE (FlagLT_UGT) yes no) -> (First nil yes no)
-(NE (FlagGT_ULT) yes no) -> (First nil yes no)
-(NE (FlagGT_UGT) yes no) -> (First nil yes no)
+(NE (FlagEQ) yes no) -> (First no yes)
+(NE (FlagLT_ULT) yes no) -> (First yes no)
+(NE (FlagLT_UGT) yes no) -> (First yes no)
+(NE (FlagGT_ULT) yes no) -> (First yes no)
+(NE (FlagGT_UGT) yes no) -> (First yes no)
-(LT (FlagEQ) yes no) -> (First nil no yes)
-(LT (FlagLT_ULT) yes no) -> (First nil yes no)
-(LT (FlagLT_UGT) yes no) -> (First nil yes no)
-(LT (FlagGT_ULT) yes no) -> (First nil no yes)
-(LT (FlagGT_UGT) yes no) -> (First nil no yes)
+(LT (FlagEQ) yes no) -> (First no yes)
+(LT (FlagLT_ULT) yes no) -> (First yes no)
+(LT (FlagLT_UGT) yes no) -> (First yes no)
+(LT (FlagGT_ULT) yes no) -> (First no yes)
+(LT (FlagGT_UGT) yes no) -> (First no yes)
-(LE (FlagEQ) yes no) -> (First nil yes no)
-(LE (FlagLT_ULT) yes no) -> (First nil yes no)
-(LE (FlagLT_UGT) yes no) -> (First nil yes no)
-(LE (FlagGT_ULT) yes no) -> (First nil no yes)
-(LE (FlagGT_UGT) yes no) -> (First nil no yes)
+(LE (FlagEQ) yes no) -> (First yes no)
+(LE (FlagLT_ULT) yes no) -> (First yes no)
+(LE (FlagLT_UGT) yes no) -> (First yes no)
+(LE (FlagGT_ULT) yes no) -> (First no yes)
+(LE (FlagGT_UGT) yes no) -> (First no yes)
-(GT (FlagEQ) yes no) -> (First nil no yes)
-(GT (FlagLT_ULT) yes no) -> (First nil no yes)
-(GT (FlagLT_UGT) yes no) -> (First nil no yes)
-(GT (FlagGT_ULT) yes no) -> (First nil yes no)
-(GT (FlagGT_UGT) yes no) -> (First nil yes no)
+(GT (FlagEQ) yes no) -> (First no yes)
+(GT (FlagLT_ULT) yes no) -> (First no yes)
+(GT (FlagLT_UGT) yes no) -> (First no yes)
+(GT (FlagGT_ULT) yes no) -> (First yes no)
+(GT (FlagGT_UGT) yes no) -> (First yes no)
-(GE (FlagEQ) yes no) -> (First nil yes no)
-(GE (FlagLT_ULT) yes no) -> (First nil no yes)
-(GE (FlagLT_UGT) yes no) -> (First nil no yes)
-(GE (FlagGT_ULT) yes no) -> (First nil yes no)
-(GE (FlagGT_UGT) yes no) -> (First nil yes no)
+(GE (FlagEQ) yes no) -> (First yes no)
+(GE (FlagLT_ULT) yes no) -> (First no yes)
+(GE (FlagLT_UGT) yes no) -> (First no yes)
+(GE (FlagGT_ULT) yes no) -> (First yes no)
+(GE (FlagGT_UGT) yes no) -> (First yes no)
-(ULT (FlagEQ) yes no) -> (First nil no yes)
-(ULT (FlagLT_ULT) yes no) -> (First nil yes no)
-(ULT (FlagLT_UGT) yes no) -> (First nil no yes)
-(ULT (FlagGT_ULT) yes no) -> (First nil yes no)
-(ULT (FlagGT_UGT) yes no) -> (First nil no yes)
+(ULT (FlagEQ) yes no) -> (First no yes)
+(ULT (FlagLT_ULT) yes no) -> (First yes no)
+(ULT (FlagLT_UGT) yes no) -> (First no yes)
+(ULT (FlagGT_ULT) yes no) -> (First yes no)
+(ULT (FlagGT_UGT) yes no) -> (First no yes)
-(ULE (FlagEQ) yes no) -> (First nil yes no)
-(ULE (FlagLT_ULT) yes no) -> (First nil yes no)
-(ULE (FlagLT_UGT) yes no) -> (First nil no yes)
-(ULE (FlagGT_ULT) yes no) -> (First nil yes no)
-(ULE (FlagGT_UGT) yes no) -> (First nil no yes)
+(ULE (FlagEQ) yes no) -> (First yes no)
+(ULE (FlagLT_ULT) yes no) -> (First yes no)
+(ULE (FlagLT_UGT) yes no) -> (First no yes)
+(ULE (FlagGT_ULT) yes no) -> (First yes no)
+(ULE (FlagGT_UGT) yes no) -> (First no yes)
-(UGT (FlagEQ) yes no) -> (First nil no yes)
-(UGT (FlagLT_ULT) yes no) -> (First nil no yes)
-(UGT (FlagLT_UGT) yes no) -> (First nil yes no)
-(UGT (FlagGT_ULT) yes no) -> (First nil no yes)
-(UGT (FlagGT_UGT) yes no) -> (First nil yes no)
+(UGT (FlagEQ) yes no) -> (First no yes)
+(UGT (FlagLT_ULT) yes no) -> (First no yes)
+(UGT (FlagLT_UGT) yes no) -> (First yes no)
+(UGT (FlagGT_ULT) yes no) -> (First no yes)
+(UGT (FlagGT_UGT) yes no) -> (First yes no)
-(UGE (FlagEQ) yes no) -> (First nil yes no)
-(UGE (FlagLT_ULT) yes no) -> (First nil no yes)
-(UGE (FlagLT_UGT) yes no) -> (First nil yes no)
-(UGE (FlagGT_ULT) yes no) -> (First nil no yes)
-(UGE (FlagGT_UGT) yes no) -> (First nil yes no)
+(UGE (FlagEQ) yes no) -> (First yes no)
+(UGE (FlagLT_ULT) yes no) -> (First no yes)
+(UGE (FlagLT_UGT) yes no) -> (First yes no)
+(UGE (FlagGT_ULT) yes no) -> (First no yes)
+(UGE (FlagGT_UGT) yes no) -> (First yes no)
-(Z (MOVDconst [0]) yes no) -> (First nil yes no)
-(Z (MOVDconst [c]) yes no) && c != 0 -> (First nil no yes)
-(NZ (MOVDconst [0]) yes no) -> (First nil no yes)
-(NZ (MOVDconst [c]) yes no) && c != 0 -> (First nil yes no)
-(ZW (MOVDconst [c]) yes no) && int32(c) == 0 -> (First nil yes no)
-(ZW (MOVDconst [c]) yes no) && int32(c) != 0 -> (First nil no yes)
-(NZW (MOVDconst [c]) yes no) && int32(c) == 0 -> (First nil no yes)
-(NZW (MOVDconst [c]) yes no) && int32(c) != 0 -> (First nil yes no)
+(Z (MOVDconst [0]) yes no) -> (First yes no)
+(Z (MOVDconst [c]) yes no) && c != 0 -> (First no yes)
+(NZ (MOVDconst [0]) yes no) -> (First no yes)
+(NZ (MOVDconst [c]) yes no) && c != 0 -> (First yes no)
+(ZW (MOVDconst [c]) yes no) && int32(c) == 0 -> (First yes no)
+(ZW (MOVDconst [c]) yes no) && int32(c) != 0 -> (First no yes)
+(NZW (MOVDconst [c]) yes no) && int32(c) == 0 -> (First no yes)
+(NZW (MOVDconst [c]) yes no) && int32(c) != 0 -> (First yes no)
// absorb InvertFlags into branches
(LT (InvertFlags cmp) yes no) -> (GT cmp yes no)
diff --git a/src/cmd/compile/internal/ssa/gen/ARM64Ops.go b/src/cmd/compile/internal/ssa/gen/ARM64Ops.go
index d4de904a24..e1f045fcf8 100644
--- a/src/cmd/compile/internal/ssa/gen/ARM64Ops.go
+++ b/src/cmd/compile/internal/ssa/gen/ARM64Ops.go
@@ -678,26 +678,26 @@ func init() {
}
blocks := []blockData{
- {name: "EQ"},
- {name: "NE"},
- {name: "LT"},
- {name: "LE"},
- {name: "GT"},
- {name: "GE"},
- {name: "ULT"},
- {name: "ULE"},
- {name: "UGT"},
- {name: "UGE"},
- {name: "Z"}, // Control == 0 (take a register instead of flags)
- {name: "NZ"}, // Control != 0
- {name: "ZW"}, // Control == 0, 32-bit
- {name: "NZW"}, // Control != 0, 32-bit
- {name: "TBZ"}, // Control & (1 << Aux.(int64)) == 0
- {name: "TBNZ"}, // Control & (1 << Aux.(int64)) != 0
- {name: "FLT"},
- {name: "FLE"},
- {name: "FGT"},
- {name: "FGE"},
+ {name: "EQ", controls: 1},
+ {name: "NE", controls: 1},
+ {name: "LT", controls: 1},
+ {name: "LE", controls: 1},
+ {name: "GT", controls: 1},
+ {name: "GE", controls: 1},
+ {name: "ULT", controls: 1},
+ {name: "ULE", controls: 1},
+ {name: "UGT", controls: 1},
+ {name: "UGE", controls: 1},
+ {name: "Z", controls: 1}, // Control == 0 (take a register instead of flags)
+ {name: "NZ", controls: 1}, // Control != 0
+ {name: "ZW", controls: 1}, // Control == 0, 32-bit
+ {name: "NZW", controls: 1}, // Control != 0, 32-bit
+ {name: "TBZ", controls: 1}, // Control & (1 << Aux.(int64)) == 0
+ {name: "TBNZ", controls: 1}, // Control & (1 << Aux.(int64)) != 0
+ {name: "FLT", controls: 1},
+ {name: "FLE", controls: 1},
+ {name: "FGT", controls: 1},
+ {name: "FGE", controls: 1},
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/ARMOps.go b/src/cmd/compile/internal/ssa/gen/ARMOps.go
index eb0f671d0d..2983870486 100644
--- a/src/cmd/compile/internal/ssa/gen/ARMOps.go
+++ b/src/cmd/compile/internal/ssa/gen/ARMOps.go
@@ -568,16 +568,16 @@ func init() {
}
blocks := []blockData{
- {name: "EQ"},
- {name: "NE"},
- {name: "LT"},
- {name: "LE"},
- {name: "GT"},
- {name: "GE"},
- {name: "ULT"},
- {name: "ULE"},
- {name: "UGT"},
- {name: "UGE"},
+ {name: "EQ", controls: 1},
+ {name: "NE", controls: 1},
+ {name: "LT", controls: 1},
+ {name: "LE", controls: 1},
+ {name: "GT", controls: 1},
+ {name: "GE", controls: 1},
+ {name: "ULT", controls: 1},
+ {name: "ULE", controls: 1},
+ {name: "UGT", controls: 1},
+ {name: "UGE", controls: 1},
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/MIPS.rules b/src/cmd/compile/internal/ssa/gen/MIPS.rules
index 2b3ae5d93e..2932f13ac7 100644
--- a/src/cmd/compile/internal/ssa/gen/MIPS.rules
+++ b/src/cmd/compile/internal/ssa/gen/MIPS.rules
@@ -687,18 +687,18 @@
(SGTUconst [c] (SRLconst _ [d])) && uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c) -> (MOVWconst [1])
// absorb constants into branches
-(EQ (MOVWconst [0]) yes no) -> (First nil yes no)
-(EQ (MOVWconst [c]) yes no) && c != 0 -> (First nil no yes)
-(NE (MOVWconst [0]) yes no) -> (First nil no yes)
-(NE (MOVWconst [c]) yes no) && c != 0 -> (First nil yes no)
-(LTZ (MOVWconst [c]) yes no) && int32(c) < 0 -> (First nil yes no)
-(LTZ (MOVWconst [c]) yes no) && int32(c) >= 0 -> (First nil no yes)
-(LEZ (MOVWconst [c]) yes no) && int32(c) <= 0 -> (First nil yes no)
-(LEZ (MOVWconst [c]) yes no) && int32(c) > 0 -> (First nil no yes)
-(GTZ (MOVWconst [c]) yes no) && int32(c) > 0 -> (First nil yes no)
-(GTZ (MOVWconst [c]) yes no) && int32(c) <= 0 -> (First nil no yes)
-(GEZ (MOVWconst [c]) yes no) && int32(c) >= 0 -> (First nil yes no)
-(GEZ (MOVWconst [c]) yes no) && int32(c) < 0 -> (First nil no yes)
+(EQ (MOVWconst [0]) yes no) -> (First yes no)
+(EQ (MOVWconst [c]) yes no) && c != 0 -> (First no yes)
+(NE (MOVWconst [0]) yes no) -> (First no yes)
+(NE (MOVWconst [c]) yes no) && c != 0 -> (First yes no)
+(LTZ (MOVWconst [c]) yes no) && int32(c) < 0 -> (First yes no)
+(LTZ (MOVWconst [c]) yes no) && int32(c) >= 0 -> (First no yes)
+(LEZ (MOVWconst [c]) yes no) && int32(c) <= 0 -> (First yes no)
+(LEZ (MOVWconst [c]) yes no) && int32(c) > 0 -> (First no yes)
+(GTZ (MOVWconst [c]) yes no) && int32(c) > 0 -> (First yes no)
+(GTZ (MOVWconst [c]) yes no) && int32(c) <= 0 -> (First no yes)
+(GEZ (MOVWconst [c]) yes no) && int32(c) >= 0 -> (First yes no)
+(GEZ (MOVWconst [c]) yes no) && int32(c) < 0 -> (First no yes)
// conditional move
(CMOVZ _ f (MOVWconst [0])) -> f
diff --git a/src/cmd/compile/internal/ssa/gen/MIPS64.rules b/src/cmd/compile/internal/ssa/gen/MIPS64.rules
index 69fe4b721e..a39241d160 100644
--- a/src/cmd/compile/internal/ssa/gen/MIPS64.rules
+++ b/src/cmd/compile/internal/ssa/gen/MIPS64.rules
@@ -694,15 +694,15 @@
(SGTUconst [c] (SRLVconst _ [d])) && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c) -> (MOVVconst [1])
// absorb constants into branches
-(EQ (MOVVconst [0]) yes no) -> (First nil yes no)
-(EQ (MOVVconst [c]) yes no) && c != 0 -> (First nil no yes)
-(NE (MOVVconst [0]) yes no) -> (First nil no yes)
-(NE (MOVVconst [c]) yes no) && c != 0 -> (First nil yes no)
-(LTZ (MOVVconst [c]) yes no) && c < 0 -> (First nil yes no)
-(LTZ (MOVVconst [c]) yes no) && c >= 0 -> (First nil no yes)
-(LEZ (MOVVconst [c]) yes no) && c <= 0 -> (First nil yes no)
-(LEZ (MOVVconst [c]) yes no) && c > 0 -> (First nil no yes)
-(GTZ (MOVVconst [c]) yes no) && c > 0 -> (First nil yes no)
-(GTZ (MOVVconst [c]) yes no) && c <= 0 -> (First nil no yes)
-(GEZ (MOVVconst [c]) yes no) && c >= 0 -> (First nil yes no)
-(GEZ (MOVVconst [c]) yes no) && c < 0 -> (First nil no yes)
+(EQ (MOVVconst [0]) yes no) -> (First yes no)
+(EQ (MOVVconst [c]) yes no) && c != 0 -> (First no yes)
+(NE (MOVVconst [0]) yes no) -> (First no yes)
+(NE (MOVVconst [c]) yes no) && c != 0 -> (First yes no)
+(LTZ (MOVVconst [c]) yes no) && c < 0 -> (First yes no)
+(LTZ (MOVVconst [c]) yes no) && c >= 0 -> (First no yes)
+(LEZ (MOVVconst [c]) yes no) && c <= 0 -> (First yes no)
+(LEZ (MOVVconst [c]) yes no) && c > 0 -> (First no yes)
+(GTZ (MOVVconst [c]) yes no) && c > 0 -> (First yes no)
+(GTZ (MOVVconst [c]) yes no) && c <= 0 -> (First no yes)
+(GEZ (MOVVconst [c]) yes no) && c >= 0 -> (First yes no)
+(GEZ (MOVVconst [c]) yes no) && c < 0 -> (First no yes)
diff --git a/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go b/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go
index e0a920f23d..184b119f89 100644
--- a/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go
+++ b/src/cmd/compile/internal/ssa/gen/MIPS64Ops.go
@@ -453,14 +453,14 @@ func init() {
}
blocks := []blockData{
- {name: "EQ"},
- {name: "NE"},
- {name: "LTZ"}, // < 0
- {name: "LEZ"}, // <= 0
- {name: "GTZ"}, // > 0
- {name: "GEZ"}, // >= 0
- {name: "FPT"}, // FP flag is true
- {name: "FPF"}, // FP flag is false
+ {name: "EQ", controls: 1},
+ {name: "NE", controls: 1},
+ {name: "LTZ", controls: 1}, // < 0
+ {name: "LEZ", controls: 1}, // <= 0
+ {name: "GTZ", controls: 1}, // > 0
+ {name: "GEZ", controls: 1}, // >= 0
+ {name: "FPT", controls: 1}, // FP flag is true
+ {name: "FPF", controls: 1}, // FP flag is false
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/MIPSOps.go b/src/cmd/compile/internal/ssa/gen/MIPSOps.go
index 729cc05102..0f7b985e06 100644
--- a/src/cmd/compile/internal/ssa/gen/MIPSOps.go
+++ b/src/cmd/compile/internal/ssa/gen/MIPSOps.go
@@ -409,14 +409,14 @@ func init() {
}
blocks := []blockData{
- {name: "EQ"},
- {name: "NE"},
- {name: "LTZ"}, // < 0
- {name: "LEZ"}, // <= 0
- {name: "GTZ"}, // > 0
- {name: "GEZ"}, // >= 0
- {name: "FPT"}, // FP flag is true
- {name: "FPF"}, // FP flag is false
+ {name: "EQ", controls: 1},
+ {name: "NE", controls: 1},
+ {name: "LTZ", controls: 1}, // < 0
+ {name: "LEZ", controls: 1}, // <= 0
+ {name: "GTZ", controls: 1}, // > 0
+ {name: "GEZ", controls: 1}, // >= 0
+ {name: "FPT", controls: 1}, // FP flag is true
+ {name: "FPF", controls: 1}, // FP flag is false
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/PPC64.rules b/src/cmd/compile/internal/ssa/gen/PPC64.rules
index b247a0b99e..59cce4ed57 100644
--- a/src/cmd/compile/internal/ssa/gen/PPC64.rules
+++ b/src/cmd/compile/internal/ssa/gen/PPC64.rules
@@ -447,29 +447,29 @@
(NE (CMPWconst [0] (ANDconst [c] x)) yes no) -> (NE (ANDCCconst [c] x) yes no)
// absorb flag constants into branches
-(EQ (FlagEQ) yes no) -> (First nil yes no)
-(EQ (FlagLT) yes no) -> (First nil no yes)
-(EQ (FlagGT) yes no) -> (First nil no yes)
+(EQ (FlagEQ) yes no) -> (First yes no)
+(EQ (FlagLT) yes no) -> (First no yes)
+(EQ (FlagGT) yes no) -> (First no yes)
-(NE (FlagEQ) yes no) -> (First nil no yes)
-(NE (FlagLT) yes no) -> (First nil yes no)
-(NE (FlagGT) yes no) -> (First nil yes no)
+(NE (FlagEQ) yes no) -> (First no yes)
+(NE (FlagLT) yes no) -> (First yes no)
+(NE (FlagGT) yes no) -> (First yes no)
-(LT (FlagEQ) yes no) -> (First nil no yes)
-(LT (FlagLT) yes no) -> (First nil yes no)
-(LT (FlagGT) yes no) -> (First nil no yes)
+(LT (FlagEQ) yes no) -> (First no yes)
+(LT (FlagLT) yes no) -> (First yes no)
+(LT (FlagGT) yes no) -> (First no yes)
-(LE (FlagEQ) yes no) -> (First nil yes no)
-(LE (FlagLT) yes no) -> (First nil yes no)
-(LE (FlagGT) yes no) -> (First nil no yes)
+(LE (FlagEQ) yes no) -> (First yes no)
+(LE (FlagLT) yes no) -> (First yes no)
+(LE (FlagGT) yes no) -> (First no yes)
-(GT (FlagEQ) yes no) -> (First nil no yes)
-(GT (FlagLT) yes no) -> (First nil no yes)
-(GT (FlagGT) yes no) -> (First nil yes no)
+(GT (FlagEQ) yes no) -> (First no yes)
+(GT (FlagLT) yes no) -> (First no yes)
+(GT (FlagGT) yes no) -> (First yes no)
-(GE (FlagEQ) yes no) -> (First nil yes no)
-(GE (FlagLT) yes no) -> (First nil no yes)
-(GE (FlagGT) yes no) -> (First nil yes no)
+(GE (FlagEQ) yes no) -> (First yes no)
+(GE (FlagLT) yes no) -> (First no yes)
+(GE (FlagGT) yes no) -> (First yes no)
// absorb InvertFlags into branches
(LT (InvertFlags cmp) yes no) -> (GT cmp yes no)
diff --git a/src/cmd/compile/internal/ssa/gen/PPC64Ops.go b/src/cmd/compile/internal/ssa/gen/PPC64Ops.go
index 138fe23ca8..5505db5222 100644
--- a/src/cmd/compile/internal/ssa/gen/PPC64Ops.go
+++ b/src/cmd/compile/internal/ssa/gen/PPC64Ops.go
@@ -585,16 +585,16 @@ func init() {
}
blocks := []blockData{
- {name: "EQ"},
- {name: "NE"},
- {name: "LT"},
- {name: "LE"},
- {name: "GT"},
- {name: "GE"},
- {name: "FLT"},
- {name: "FLE"},
- {name: "FGT"},
- {name: "FGE"},
+ {name: "EQ", controls: 1},
+ {name: "NE", controls: 1},
+ {name: "LT", controls: 1},
+ {name: "LE", controls: 1},
+ {name: "GT", controls: 1},
+ {name: "GE", controls: 1},
+ {name: "FLT", controls: 1},
+ {name: "FLE", controls: 1},
+ {name: "FGT", controls: 1},
+ {name: "FGE", controls: 1},
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/S390X.rules b/src/cmd/compile/internal/ssa/gen/S390X.rules
index e30312e454..83c3b358b5 100644
--- a/src/cmd/compile/internal/ssa/gen/S390X.rules
+++ b/src/cmd/compile/internal/ssa/gen/S390X.rules
@@ -976,15 +976,15 @@
(CMP(W|W|WU|WU)const (MOV(W|WZ|W|WZ)reg x) [c]) -> (CMP(W|W|WU|WU)const x [c])
// Absorb flag constants into branches.
-(BRC {c} (FlagEQ) yes no) && c.(s390x.CCMask) & s390x.Equal != 0 -> (First nil yes no)
-(BRC {c} (FlagLT) yes no) && c.(s390x.CCMask) & s390x.Less != 0 -> (First nil yes no)
-(BRC {c} (FlagGT) yes no) && c.(s390x.CCMask) & s390x.Greater != 0 -> (First nil yes no)
-(BRC {c} (FlagOV) yes no) && c.(s390x.CCMask) & s390x.Unordered != 0 -> (First nil yes no)
+(BRC {c} (FlagEQ) yes no) && c.(s390x.CCMask) & s390x.Equal != 0 -> (First yes no)
+(BRC {c} (FlagLT) yes no) && c.(s390x.CCMask) & s390x.Less != 0 -> (First yes no)
+(BRC {c} (FlagGT) yes no) && c.(s390x.CCMask) & s390x.Greater != 0 -> (First yes no)
+(BRC {c} (FlagOV) yes no) && c.(s390x.CCMask) & s390x.Unordered != 0 -> (First yes no)
-(BRC {c} (FlagEQ) yes no) && c.(s390x.CCMask) & s390x.Equal == 0 -> (First nil no yes)
-(BRC {c} (FlagLT) yes no) && c.(s390x.CCMask) & s390x.Less == 0 -> (First nil no yes)
-(BRC {c} (FlagGT) yes no) && c.(s390x.CCMask) & s390x.Greater == 0 -> (First nil no yes)
-(BRC {c} (FlagOV) yes no) && c.(s390x.CCMask) & s390x.Unordered == 0 -> (First nil no yes)
+(BRC {c} (FlagEQ) yes no) && c.(s390x.CCMask) & s390x.Equal == 0 -> (First no yes)
+(BRC {c} (FlagLT) yes no) && c.(s390x.CCMask) & s390x.Less == 0 -> (First no yes)
+(BRC {c} (FlagGT) yes no) && c.(s390x.CCMask) & s390x.Greater == 0 -> (First no yes)
+(BRC {c} (FlagOV) yes no) && c.(s390x.CCMask) & s390x.Unordered == 0 -> (First no yes)
// Absorb flag constants into SETxx ops.
(LOCGR {c} _ x (FlagEQ)) && c.(s390x.CCMask) & s390x.Equal != 0 -> x
diff --git a/src/cmd/compile/internal/ssa/gen/S390XOps.go b/src/cmd/compile/internal/ssa/gen/S390XOps.go
index c8e4a22846..d34c250cf6 100644
--- a/src/cmd/compile/internal/ssa/gen/S390XOps.go
+++ b/src/cmd/compile/internal/ssa/gen/S390XOps.go
@@ -708,7 +708,7 @@ func init() {
}
var S390Xblocks = []blockData{
- {name: "BRC"}, // aux is condition code mask (s390x.CCMask)
+ {name: "BRC", controls: 1}, // aux is condition code mask (s390x.CCMask)
}
archs = append(archs, arch{
diff --git a/src/cmd/compile/internal/ssa/gen/generic.rules b/src/cmd/compile/internal/ssa/gen/generic.rules
index 8696464a70..1503a5da6c 100644
--- a/src/cmd/compile/internal/ssa/gen/generic.rules
+++ b/src/cmd/compile/internal/ssa/gen/generic.rules
@@ -879,8 +879,8 @@
(NilCheck (GetG mem) mem) -> mem
(If (Not cond) yes no) -> (If cond no yes)
-(If (ConstBool [c]) yes no) && c == 1 -> (First nil yes no)
-(If (ConstBool [c]) yes no) && c == 0 -> (First nil no yes)
+(If (ConstBool [c]) yes no) && c == 1 -> (First yes no)
+(If (ConstBool [c]) yes no) && c == 0 -> (First no yes)
// Get rid of Convert ops for pointer arithmetic on unsafe.Pointer.
(Convert (Add(64|32) (Convert ptr mem) off) mem) -> (Add(64|32) ptr off)
diff --git a/src/cmd/compile/internal/ssa/gen/genericOps.go b/src/cmd/compile/internal/ssa/gen/genericOps.go
index 3ca773b595..df0dd8cabc 100644
--- a/src/cmd/compile/internal/ssa/gen/genericOps.go
+++ b/src/cmd/compile/internal/ssa/gen/genericOps.go
@@ -557,24 +557,22 @@ var genericOps = []opData{
{name: "Clobber", argLength: 0, typ: "Void", aux: "SymOff", symEffect: "None"}, // write an invalid pointer value to the given pointer slot of a stack variable
}
-// kind control successors implicit exit
+// kind controls successors implicit exit
// ----------------------------------------------------------
-// Exit return mem [] yes
-// Ret return mem [] yes
-// RetJmp return mem [] yes
-// Plain nil [next]
-// If a boolean Value [then, else]
-// Call mem [next] yes (control opcode should be OpCall or OpStaticCall)
-// Check void [next] yes (control opcode should be Op{Lowered}NilCheck)
-// First nil [always,never]
+// Exit [return mem] [] yes
+// Ret [return mem] [] yes
+// RetJmp [return mem] [] yes
+// Plain [] [next]
+// If [boolean Value] [then, else]
+// First [] [always, never]
var genericBlocks = []blockData{
- {name: "Plain"}, // a single successor
- {name: "If"}, // 2 successors, if control goto Succs[0] else goto Succs[1]
- {name: "Defer"}, // 2 successors, Succs[0]=defer queued, Succs[1]=defer recovered. control is call op (of memory type)
- {name: "Ret"}, // no successors, control value is memory result
- {name: "RetJmp"}, // no successors, jumps to b.Aux.(*gc.Sym)
- {name: "Exit"}, // no successors, control value generates a panic
+ {name: "Plain"}, // a single successor
+ {name: "If", controls: 1}, // if Controls[0] goto Succs[0] else goto Succs[1]
+ {name: "Defer", controls: 1}, // Succs[0]=defer queued, Succs[1]=defer recovered. Controls[0] is call op (of memory type)
+ {name: "Ret", controls: 1}, // no successors, Controls[0] value is memory result
+ {name: "RetJmp", controls: 1}, // no successors, Controls[0] value is memory result, jumps to b.Aux.(*gc.Sym)
+ {name: "Exit", controls: 1}, // no successors, Controls[0] value generates a panic
// transient block state used for dead code removal
{name: "First"}, // 2 successors, always takes the first one (second is dead)
diff --git a/src/cmd/compile/internal/ssa/gen/main.go b/src/cmd/compile/internal/ssa/gen/main.go
index decc583431..eef72284b9 100644
--- a/src/cmd/compile/internal/ssa/gen/main.go
+++ b/src/cmd/compile/internal/ssa/gen/main.go
@@ -68,7 +68,8 @@ type opData struct {
}
type blockData struct {
- name string
+ name string // the suffix for this block ("EQ", "LT", etc.)
+ controls int // the number of control values this type of block requires
}
type regInfo struct {
diff --git a/src/cmd/compile/internal/ssa/gen/rulegen.go b/src/cmd/compile/internal/ssa/gen/rulegen.go
index 994e5b932f..5c4c5ef1af 100644
--- a/src/cmd/compile/internal/ssa/gen/rulegen.go
+++ b/src/cmd/compile/internal/ssa/gen/rulegen.go
@@ -237,8 +237,7 @@ func genRulesSuffix(arch arch, suff string) {
// so we can make this one function with a switch.
fn = &Func{kind: "Block"}
fn.add(declf("config", "b.Func.Config"))
- fn.add(declf("typ", "&config.Types"))
- fn.add(declf("v", "b.Control"))
+ fn.add(declf("typ", "&b.Func.Config.Types"))
sw = &Switch{expr: exprf("b.Kind")}
ops = ops[:0]
@@ -247,9 +246,10 @@ func genRulesSuffix(arch arch, suff string) {
}
sort.Strings(ops)
for _, op := range ops {
- swc := &Case{expr: exprf("%s", blockName(op, arch))}
+ name, data := getBlockInfo(op, arch)
+ swc := &Case{expr: exprf("%s", name)}
for _, rule := range blockrules[op] {
- swc.add(genBlockRewrite(rule, arch))
+ swc.add(genBlockRewrite(rule, arch, data))
}
sw.add(swc)
}
@@ -593,11 +593,7 @@ func fprint(w io.Writer, n Node) {
fmt.Fprintf(w, "// cond: %s\n", n.cond)
}
fmt.Fprintf(w, "// result: %s\n", n.result)
- if n.checkOp != "" {
- fmt.Fprintf(w, "for v.Op == %s {\n", n.checkOp)
- } else {
- fmt.Fprintf(w, "for {\n")
- }
+ fmt.Fprintf(w, "for %s {\n", n.check)
for _, n := range n.list {
fprint(w, n)
}
@@ -700,7 +696,7 @@ type (
RuleRewrite struct {
bodyBase
match, cond, result string // top comments
- checkOp string
+ check string // top-level boolean expression
alloc int // for unique var names
loc string // file name & line number of the original rule
@@ -750,18 +746,39 @@ func breakf(format string, a ...interface{}) *CondBreak {
return &CondBreak{exprf(format, a...)}
}
-func genBlockRewrite(rule Rule, arch arch) *RuleRewrite {
+func genBlockRewrite(rule Rule, arch arch, data blockData) *RuleRewrite {
rr := &RuleRewrite{loc: rule.loc}
rr.match, rr.cond, rr.result = rule.parse()
_, _, _, aux, s := extract(rr.match) // remove parens, then split
- // check match of control value
- pos := ""
- if s[0] != "nil" {
- if strings.Contains(s[0], "(") {
- pos, rr.checkOp = genMatch0(rr, arch, s[0], "v")
+ // check match of control values
+ if len(s) < data.controls {
+ log.Fatalf("incorrect number of arguments in %s, got %v wanted at least %v", rule, len(s), data.controls)
+ }
+ controls := s[:data.controls]
+ pos := make([]string, data.controls)
+ for i, arg := range controls {
+ if strings.Contains(arg, "(") {
+ // TODO: allow custom names?
+ cname := fmt.Sprintf("b.Controls[%v]", i)
+ vname := fmt.Sprintf("v_%v", i)
+ rr.add(declf(vname, cname))
+ p, op := genMatch0(rr, arch, arg, vname)
+ if op != "" {
+ check := fmt.Sprintf("%s.Op == %s", cname, op)
+ if rr.check == "" {
+ rr.check = check
+ } else {
+ rr.check = rr.check + " && " + check
+ }
+ }
+ if p == "" {
+ p = vname + ".Pos"
+ }
+ pos[i] = p
} else {
- rr.add(declf(s[0], "b.Control"))
+ rr.add(declf(arg, "b.Controls[%v]", i))
+ pos[i] = arg + ".Pos"
}
}
if aux != "" {
@@ -773,10 +790,14 @@ func genBlockRewrite(rule Rule, arch arch) *RuleRewrite {
// Rule matches. Generate result.
outop, _, _, aux, t := extract(rr.result) // remove parens, then split
- newsuccs := t[1:]
+ _, outdata := getBlockInfo(outop, arch)
+ if len(t) < outdata.controls {
+ log.Fatalf("incorrect number of output arguments in %s, got %v wanted at least %v", rule, len(s), outdata.controls)
+ }
// Check if newsuccs is the same set as succs.
- succs := s[1:]
+ succs := s[data.controls:]
+ newsuccs := t[outdata.controls:]
m := map[string]bool{}
for _, succ := range succs {
if m[succ] {
@@ -794,15 +815,23 @@ func genBlockRewrite(rule Rule, arch arch) *RuleRewrite {
log.Fatalf("unmatched successors %v in %s", m, rule)
}
- rr.add(stmtf("b.Kind = %s", blockName(outop, arch)))
- if t[0] == "nil" {
- rr.add(stmtf("b.SetControl(nil)"))
- } else {
- if pos == "" {
- pos = "v.Pos"
+ blockName, _ := getBlockInfo(outop, arch)
+ rr.add(stmtf("b.Kind = %s", blockName))
+ rr.add(stmtf("b.ResetControls()"))
+ for i, control := range t[:outdata.controls] {
+ // Select a source position for any new control values.
+ // TODO: does it always make sense to use the source position
+ // of the original control values or should we be using the
+ // block's source position in some cases?
+ newpos := "b.Pos" // default to block's source position
+ if i < len(pos) && pos[i] != "" {
+ // Use the previous control value's source position.
+ newpos = pos[i]
}
- v := genResult0(rr, arch, t[0], false, false, pos)
- rr.add(stmtf("b.SetControl(%s)", v))
+
+ // Generate a new control value (or copy an existing value).
+ v := genResult0(rr, arch, control, false, false, newpos)
+ rr.add(stmtf("b.AddControl(%s)", v))
}
if aux != "" {
rr.add(stmtf("b.Aux = %s", aux))
@@ -851,28 +880,21 @@ func genMatch0(rr *RuleRewrite, arch arch, match, v string) (pos, checkOp string
pos = v + ".Pos"
}
- if typ != "" {
- if !token.IsIdentifier(typ) || rr.declared(typ) {
- // code or variable
- rr.add(breakf("%s.Type != %s", v, typ))
- } else {
- rr.add(declf(typ, "%s.Type", v))
- }
- }
- if auxint != "" {
- if !token.IsIdentifier(auxint) || rr.declared(auxint) {
- // code or variable
- rr.add(breakf("%s.AuxInt != %s", v, auxint))
- } else {
- rr.add(declf(auxint, "%s.AuxInt", v))
+ for _, e := range []struct {
+ name, field string
+ }{
+ {typ, "Type"},
+ {auxint, "AuxInt"},
+ {aux, "Aux"},
+ } {
+ if e.name == "" {
+ continue
}
- }
- if aux != "" {
- if !token.IsIdentifier(aux) || rr.declared(aux) {
+ if !token.IsIdentifier(e.name) || rr.declared(e.name) {
// code or variable
- rr.add(breakf("%s.Aux != %s", v, aux))
+ rr.add(breakf("%s.%s != %s", v, e.field, e.name))
} else {
- rr.add(declf(aux, "%s.Aux", v))
+ rr.add(declf(e.name, "%s.%s", v, e.field))
}
}
@@ -921,7 +943,6 @@ func genMatch0(rr *RuleRewrite, arch arch, match, v string) (pos, checkOp string
rr.add(declf(argname, "%s.Args[%d]", v, i))
bexpr := exprf("%s.Op != addLater", argname)
rr.add(&CondBreak{expr: bexpr})
- rr.canFail = true // since we're not using breakf
argPos, argCheckOp := genMatch0(rr, arch, arg, argname)
bexpr.(*ast.BinaryExpr).Y.(*ast.Ident).Name = argCheckOp
@@ -1172,13 +1193,19 @@ func parseValue(val string, arch arch, loc string) (op opData, oparch, typ, auxi
return
}
-func blockName(name string, arch arch) string {
+func getBlockInfo(op string, arch arch) (name string, data blockData) {
for _, b := range genericBlocks {
- if b.name == name {
- return "Block" + name
+ if b.name == op {
+ return "Block" + op, b
+ }
+ }
+ for _, b := range arch.blocks {
+ if b.name == op {
+ return "Block" + arch.name + op, b
}
}
- return "Block" + arch.name + name
+ log.Fatalf("could not find block data for %s", op)
+ panic("unreachable")
}
// typeName returns the string to use to generate a type.
diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go
index a1b718096d..1e76a673ef 100644
--- a/src/cmd/compile/internal/ssa/html.go
+++ b/src/cmd/compile/internal/ssa/html.go
@@ -846,8 +846,8 @@ func (b *Block) LongHTML() string {
if b.Aux != nil {
s += html.EscapeString(fmt.Sprintf(" {%v}", b.Aux))
}
- if b.Control != nil {
- s += fmt.Sprintf(" %s", b.Control.HTML())
+ for _, c := range b.ControlValues() {
+ s += fmt.Sprintf(" %s", c.HTML())
}
if len(b.Succs) > 0 {
s += " &#8594;" // right arrow
diff --git a/src/cmd/compile/internal/ssa/loopbce.go b/src/cmd/compile/internal/ssa/loopbce.go
index bfa2597493..d53014943d 100644
--- a/src/cmd/compile/internal/ssa/loopbce.go
+++ b/src/cmd/compile/internal/ssa/loopbce.go
@@ -96,17 +96,18 @@ func findIndVar(f *Func) []indVar {
// Check thet the control if it either ind </<= max or max >/>= ind.
// TODO: Handle 32-bit comparisons.
// TODO: Handle unsigned comparisons?
- switch b.Control.Op {
+ c := b.Controls[0]
+ switch c.Op {
case OpLeq64:
flags |= indVarMaxInc
fallthrough
case OpLess64:
- ind, max = b.Control.Args[0], b.Control.Args[1]
+ ind, max = c.Args[0], c.Args[1]
case OpGeq64:
flags |= indVarMaxInc
fallthrough
case OpGreater64:
- ind, max = b.Control.Args[1], b.Control.Args[0]
+ ind, max = c.Args[1], c.Args[0]
default:
continue
}
@@ -207,7 +208,7 @@ func findIndVar(f *Func) []indVar {
}
// Handle induction variables of these forms.
// KNN is known-not-negative.
- // SIGNED ARITHMETIC ONLY. (see switch on b.Control.Op above)
+ // SIGNED ARITHMETIC ONLY. (see switch on c above)
// Possibilities for KNN are len and cap; perhaps we can infer others.
// for i := 0; i <= KNN-k ; i += k
// for i := 0; i < KNN-(k-1); i += k
diff --git a/src/cmd/compile/internal/ssa/nilcheck.go b/src/cmd/compile/internal/ssa/nilcheck.go
index 54c9c9d7de..9516d58a6e 100644
--- a/src/cmd/compile/internal/ssa/nilcheck.go
+++ b/src/cmd/compile/internal/ssa/nilcheck.go
@@ -99,9 +99,8 @@ func nilcheckelim(f *Func) {
// First, see if we're dominated by an explicit nil check.
if len(b.Preds) == 1 {
p := b.Preds[0].b
- if p.Kind == BlockIf && p.Control.Op == OpIsNonNil && p.Succs[0].b == b {
- ptr := p.Control.Args[0]
- if !nonNilValues[ptr.ID] {
+ if p.Kind == BlockIf && p.Controls[0].Op == OpIsNonNil && p.Succs[0].b == b {
+ if ptr := p.Controls[0].Args[0]; !nonNilValues[ptr.ID] {
nonNilValues[ptr.ID] = true
work = append(work, bp{op: ClearPtr, ptr: ptr})
}
@@ -154,12 +153,20 @@ func nilcheckelim(f *Func) {
work = append(work, bp{op: ClearPtr, ptr: ptr})
fallthrough // a non-eliminated nil check might be a good place for a statement boundary.
default:
- if pendingLines.contains(v.Pos) && v.Pos.IsStmt() != src.PosNotStmt {
+ if v.Pos.IsStmt() != src.PosNotStmt && !isPoorStatementOp(v.Op) && pendingLines.contains(v.Pos) {
v.Pos = v.Pos.WithIsStmt()
pendingLines.remove(v.Pos)
}
}
}
+ // This reduces the lost statement count in "go" by 5 (out of 500 total).
+ for j := 0; j < i; j++ { // is this an ordering problem?
+ v := b.Values[j]
+ if v.Pos.IsStmt() != src.PosNotStmt && !isPoorStatementOp(v.Op) && pendingLines.contains(v.Pos) {
+ v.Pos = v.Pos.WithIsStmt()
+ pendingLines.remove(v.Pos)
+ }
+ }
if pendingLines.contains(b.Pos) {
b.Pos = b.Pos.WithIsStmt()
pendingLines.remove(b.Pos)
diff --git a/src/cmd/compile/internal/ssa/nilcheck_test.go b/src/cmd/compile/internal/ssa/nilcheck_test.go
index b2f5cae088..e984069022 100644
--- a/src/cmd/compile/internal/ssa/nilcheck_test.go
+++ b/src/cmd/compile/internal/ssa/nilcheck_test.go
@@ -59,7 +59,7 @@ func ptrn(n int) string { return "p" + strconv.Itoa(n) }
func booln(n int) string { return "c" + strconv.Itoa(n) }
func isNilCheck(b *Block) bool {
- return b.Kind == BlockIf && b.Control.Op == OpIsNonNil
+ return b.Kind == BlockIf && b.Controls[0].Op == OpIsNonNil
}
// TestNilcheckSimple verifies that a second repeated nilcheck is removed.
diff --git a/src/cmd/compile/internal/ssa/numberlines.go b/src/cmd/compile/internal/ssa/numberlines.go
index 4807da731c..68195e9b65 100644
--- a/src/cmd/compile/internal/ssa/numberlines.go
+++ b/src/cmd/compile/internal/ssa/numberlines.go
@@ -15,7 +15,9 @@ func isPoorStatementOp(op Op) bool {
switch op {
// Note that Nilcheck often vanishes, but when it doesn't, you'd love to start the statement there
// so that a debugger-user sees the stop before the panic, and can examine the value.
- case OpAddr, OpLocalAddr, OpOffPtr, OpStructSelect, OpConstBool, OpConst8, OpConst16, OpConst32, OpConst64, OpConst32F, OpConst64F:
+ case OpAddr, OpLocalAddr, OpOffPtr, OpStructSelect, OpPhi,
+ OpIMake, OpStringMake, OpSliceMake, OpStructMake0, OpStructMake1, OpStructMake2, OpStructMake3, OpStructMake4,
+ OpConstBool, OpConst8, OpConst16, OpConst32, OpConst64, OpConst32F, OpConst64F:
return true
}
return false
@@ -43,16 +45,20 @@ func nextGoodStatementIndex(v *Value, i int, b *Block) int {
if i >= len(b.Values)-1 {
return i
}
- // Only consider the likely-ephemeral/fragile opcodes expected to vanish in a rewrite.
+ // Skip the likely-ephemeral/fragile opcodes expected to vanish in a rewrite.
if !isPoorStatementOp(v.Op) {
return i
}
// Look ahead to see what the line number is on the next thing that could be a boundary.
for j := i + 1; j < len(b.Values); j++ {
- if b.Values[j].Pos.IsStmt() == src.PosNotStmt { // ignore non-statements
+ u := b.Values[j]
+ if u.Pos.IsStmt() == src.PosNotStmt { // ignore non-statements
continue
}
- if b.Values[j].Pos.Line() == v.Pos.Line() && v.Pos.SameFile(b.Values[j].Pos) {
+ if u.Pos.SameFileAndLine(v.Pos) {
+ if isPoorStatementOp(u.Op) {
+ continue // Keep looking, this is also not a good statement op
+ }
return j
}
return i
@@ -156,18 +162,10 @@ func numberLines(f *Func) {
}
if firstPosIndex == -1 { // Effectively empty block, check block's own Pos, consider preds.
- if b.Pos.IsStmt() != src.PosNotStmt {
- b.Pos = b.Pos.WithIsStmt()
- endlines[b.ID] = b.Pos
- if f.pass.debug > 0 {
- fmt.Printf("Mark stmt effectively-empty-block %s %s %s\n", f.Name, b, flc(b.Pos))
- }
- continue
- }
line := src.NoXPos
for _, p := range b.Preds {
pbi := p.Block().ID
- if endlines[pbi] != line {
+ if !endlines[pbi].SameFileAndLine(line) {
if line == src.NoXPos {
line = endlines[pbi]
continue
@@ -178,7 +176,20 @@ func numberLines(f *Func) {
}
}
- endlines[b.ID] = line
+ // If the block has no statement itself and is effectively empty, tag it w/ predecessor(s) but not as a statement
+ if b.Pos.IsStmt() == src.PosNotStmt {
+ b.Pos = line
+ endlines[b.ID] = line
+ continue
+ }
+ // If the block differs from its predecessors, mark it as a statement
+ if line == src.NoXPos || !line.SameFileAndLine(b.Pos) {
+ b.Pos = b.Pos.WithIsStmt()
+ if f.pass.debug > 0 {
+ fmt.Printf("Mark stmt effectively-empty-block %s %s %s\n", f.Name, b, flc(b.Pos))
+ }
+ }
+ endlines[b.ID] = b.Pos
continue
}
// check predecessors for any difference; if firstPos differs, then it is a boundary.
@@ -190,7 +201,7 @@ func numberLines(f *Func) {
} else { // differing pred
for _, p := range b.Preds {
pbi := p.Block().ID
- if endlines[pbi].Line() != firstPos.Line() || !endlines[pbi].SameFile(firstPos) {
+ if !endlines[pbi].SameFileAndLine(firstPos) {
b.Values[firstPosIndex].Pos = firstPos.WithIsStmt()
if f.pass.debug > 0 {
fmt.Printf("Mark stmt differing-pred %s %s %s %s, different=%s ending %s\n",
@@ -210,7 +221,7 @@ func numberLines(f *Func) {
// skip ahead if possible
i = nextGoodStatementIndex(v, i, b)
v = b.Values[i]
- if v.Pos.Line() != firstPos.Line() || !v.Pos.SameFile(firstPos) {
+ if !v.Pos.SameFileAndLine(firstPos) {
if f.pass.debug > 0 {
fmt.Printf("Mark stmt new line %s %s %s %s prev pos = %s\n", f.Name, b, v, flc(v.Pos), flc(firstPos))
}
@@ -220,7 +231,7 @@ func numberLines(f *Func) {
v.Pos = v.Pos.WithDefaultStmt()
}
}
- if b.Pos.IsStmt() != src.PosNotStmt && (b.Pos.Line() != firstPos.Line() || !b.Pos.SameFile(firstPos)) {
+ if b.Pos.IsStmt() != src.PosNotStmt && !b.Pos.SameFileAndLine(firstPos) {
if f.pass.debug > 0 {
fmt.Printf("Mark stmt end of block differs %s %s %s prev pos = %s\n", f.Name, b, flc(b.Pos), flc(firstPos))
}
diff --git a/src/cmd/compile/internal/ssa/phiopt.go b/src/cmd/compile/internal/ssa/phiopt.go
index 60c8e58bd2..1840d6d54e 100644
--- a/src/cmd/compile/internal/ssa/phiopt.go
+++ b/src/cmd/compile/internal/ssa/phiopt.go
@@ -79,7 +79,7 @@ func phiopt(f *Func) {
if v.Args[reverse].AuxInt != v.Args[1-reverse].AuxInt {
ops := [2]Op{OpNot, OpCopy}
v.reset(ops[v.Args[reverse].AuxInt])
- v.AddArg(b0.Control)
+ v.AddArg(b0.Controls[0])
if f.pass.debug > 0 {
f.Warnl(b.Pos, "converted OpPhi to %v", v.Op)
}
@@ -95,7 +95,7 @@ func phiopt(f *Func) {
if v.Args[reverse].Op == OpConstBool && v.Args[reverse].AuxInt == 1 {
if tmp := v.Args[1-reverse]; sdom.isAncestorEq(tmp.Block, b) {
v.reset(OpOrB)
- v.SetArgs2(b0.Control, tmp)
+ v.SetArgs2(b0.Controls[0], tmp)
if f.pass.debug > 0 {
f.Warnl(b.Pos, "converted OpPhi to %v", v.Op)
}
@@ -111,7 +111,7 @@ func phiopt(f *Func) {
if v.Args[1-reverse].Op == OpConstBool && v.Args[1-reverse].AuxInt == 0 {
if tmp := v.Args[reverse]; sdom.isAncestorEq(tmp.Block, b) {
v.reset(OpAndB)
- v.SetArgs2(b0.Control, tmp)
+ v.SetArgs2(b0.Controls[0], tmp)
if f.pass.debug > 0 {
f.Warnl(b.Pos, "converted OpPhi to %v", v.Op)
}
@@ -161,7 +161,7 @@ func phioptint(v *Value, b0 *Block, reverse int) {
v.Fatalf("bad int size %d", v.Type.Size())
}
- a := b0.Control
+ a := b0.Controls[0]
if negate {
a = v.Block.NewValue1(v.Pos, OpNot, a.Type, a)
}
diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go
index 014535c0a4..4f9a4d53fb 100644
--- a/src/cmd/compile/internal/ssa/prove.go
+++ b/src/cmd/compile/internal/ssa/prove.go
@@ -5,6 +5,7 @@
package ssa
import (
+ "cmd/internal/src"
"fmt"
"math"
)
@@ -979,7 +980,7 @@ func addIndVarRestrictions(ft *factsTable, b *Block, iv indVar) {
// addBranchRestrictions updates the factsTables ft with the facts learned when
// branching from Block b in direction br.
func addBranchRestrictions(ft *factsTable, b *Block, br branch) {
- c := b.Control
+ c := b.Controls[0]
switch br {
case negative:
addRestrictions(b, ft, boolean, nil, c, eq)
@@ -988,14 +989,14 @@ func addBranchRestrictions(ft *factsTable, b *Block, br branch) {
default:
panic("unknown branch")
}
- if tr, has := domainRelationTable[b.Control.Op]; has {
+ if tr, has := domainRelationTable[c.Op]; has {
// When we branched from parent we learned a new set of
// restrictions. Update the factsTable accordingly.
d := tr.d
if d == signed && ft.isNonNegative(c.Args[0]) && ft.isNonNegative(c.Args[1]) {
d |= unsigned
}
- switch b.Control.Op {
+ switch c.Op {
case OpIsInBounds, OpIsSliceInBounds:
// 0 <= a0 < a1 (or 0 <= a0 <= a1)
//
@@ -1096,6 +1097,7 @@ func addLocalInductiveFacts(ft *factsTable, b *Block) {
if pred.Kind != BlockIf {
continue
}
+ control := pred.Controls[0]
br := unknown
if pred.Succs[0].b == child {
@@ -1108,7 +1110,7 @@ func addLocalInductiveFacts(ft *factsTable, b *Block) {
br = negative
}
- tr, has := domainRelationTable[pred.Control.Op]
+ tr, has := domainRelationTable[control.Op]
if !has {
continue
}
@@ -1121,10 +1123,10 @@ func addLocalInductiveFacts(ft *factsTable, b *Block) {
// Check for i2 < max or max > i2.
var max *Value
- if r == lt && pred.Control.Args[0] == i2 {
- max = pred.Control.Args[1]
- } else if r == gt && pred.Control.Args[1] == i2 {
- max = pred.Control.Args[0]
+ if r == lt && control.Args[0] == i2 {
+ max = control.Args[1]
+ } else if r == gt && control.Args[1] == i2 {
+ max = control.Args[0]
} else {
continue
}
@@ -1283,20 +1285,24 @@ func simplifyBlock(sdom SparseTree, ft *factsTable, b *Block) {
}
func removeBranch(b *Block, branch branch) {
+ c := b.Controls[0]
if b.Func.pass.debug > 0 {
verb := "Proved"
if branch == positive {
verb = "Disproved"
}
- c := b.Control
if b.Func.pass.debug > 1 {
b.Func.Warnl(b.Pos, "%s %s (%s)", verb, c.Op, c)
} else {
b.Func.Warnl(b.Pos, "%s %s", verb, c.Op)
}
}
+ if c != nil && c.Pos.IsStmt() == src.PosIsStmt && c.Pos.SameFileAndLine(b.Pos) {
+ // attempt to preserve statement marker.
+ b.Pos = b.Pos.WithIsStmt()
+ }
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
if branch == positive {
b.swapSuccessors()
}
diff --git a/src/cmd/compile/internal/ssa/regalloc.go b/src/cmd/compile/internal/ssa/regalloc.go
index 2590315ba1..6ffa1e3848 100644
--- a/src/cmd/compile/internal/ssa/regalloc.go
+++ b/src/cmd/compile/internal/ssa/regalloc.go
@@ -701,8 +701,10 @@ func (s *regAllocState) init(f *Func) {
for _, b := range f.Blocks {
// New block. Clear candidate set.
canLiveOnStack.clear()
- if b.Control != nil && b.Control.Uses == 1 && !opcodeTable[b.Control.Op].generic {
- canLiveOnStack.add(b.Control.ID)
+ for _, c := range b.ControlValues() {
+ if c.Uses == 1 && !opcodeTable[c.Op].generic {
+ canLiveOnStack.add(c.ID)
+ }
}
// Walking backwards.
for i := len(b.Values) - 1; i >= 0; i-- {
@@ -856,9 +858,11 @@ func (s *regAllocState) regalloc(f *Func) {
s.addUse(e.ID, int32(len(b.Values))+e.dist, e.pos) // pseudo-uses from beyond end of block
regValLiveSet.add(e.ID)
}
- if v := b.Control; v != nil && s.values[v.ID].needReg {
- s.addUse(v.ID, int32(len(b.Values)), b.Pos) // pseudo-use by control value
- regValLiveSet.add(v.ID)
+ for _, v := range b.ControlValues() {
+ if s.values[v.ID].needReg {
+ s.addUse(v.ID, int32(len(b.Values)), b.Pos) // pseudo-use by control values
+ regValLiveSet.add(v.ID)
+ }
}
for i := len(b.Values) - 1; i >= 0; i-- {
v := b.Values[i]
@@ -1503,21 +1507,32 @@ func (s *regAllocState) regalloc(f *Func) {
issueSpill:
}
- // Load control value into reg.
- if v := b.Control; v != nil && s.values[v.ID].needReg {
+ // Copy the control values - we need this so we can reduce the
+ // uses property of these values later.
+ controls := append(make([]*Value, 0, 2), b.ControlValues()...)
+
+ // Load control values into registers.
+ for i, v := range b.ControlValues() {
+ if !s.values[v.ID].needReg {
+ continue
+ }
if s.f.pass.debug > regDebug {
fmt.Printf(" processing control %s\n", v.LongString())
}
// We assume that a control input can be passed in any
// type-compatible register. If this turns out not to be true,
// we'll need to introduce a regspec for a block's control value.
- b.Control = s.allocValToReg(v, s.compatRegs(v.Type), false, b.Pos)
- if b.Control != v {
- v.Uses--
- b.Control.Uses++
+ b.ReplaceControl(i, s.allocValToReg(v, s.compatRegs(v.Type), false, b.Pos))
+ }
+
+ // Reduce the uses of the control values once registers have been loaded.
+ // This loop is equivalent to the advanceUses method.
+ for _, v := range controls {
+ vi := &s.values[v.ID]
+ if !vi.needReg {
+ continue
}
// Remove this use from the uses list.
- vi := &s.values[v.ID]
u := vi.uses
vi.uses = u.next
if u.next == nil {
@@ -2355,9 +2370,11 @@ func (s *regAllocState) computeLive() {
live.set(e.ID, e.dist+int32(len(b.Values)), e.pos)
}
- // Mark control value as live
- if b.Control != nil && s.values[b.Control.ID].needReg {
- live.set(b.Control.ID, int32(len(b.Values)), b.Pos)
+ // Mark control values as live
+ for _, c := range b.ControlValues() {
+ if s.values[c.ID].needReg {
+ live.set(c.ID, int32(len(b.Values)), b.Pos)
+ }
}
// Propagate backwards to the start of the block
diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go
index 22e17cb5da..59d7601567 100644
--- a/src/cmd/compile/internal/ssa/rewrite.go
+++ b/src/cmd/compile/internal/ssa/rewrite.go
@@ -25,9 +25,10 @@ func applyRewrite(f *Func, rb blockRewriter, rv valueRewriter) {
for {
change := false
for _, b := range f.Blocks {
- if b.Control != nil && b.Control.Op == OpCopy {
- for b.Control.Op == OpCopy {
- b.SetControl(b.Control.Args[0])
+ for i, c := range b.ControlValues() {
+ for c.Op == OpCopy {
+ c = c.Args[0]
+ b.ReplaceControl(i, c)
}
}
if rb(b) {
diff --git a/src/cmd/compile/internal/ssa/rewrite386.go b/src/cmd/compile/internal/ssa/rewrite386.go
index 08139d6ae4..bde41059f8 100644
--- a/src/cmd/compile/internal/ssa/rewrite386.go
+++ b/src/cmd/compile/internal/ssa/rewrite386.go
@@ -21975,58 +21975,59 @@ func rewriteValue386_OpZeromask_0(v *Value) bool {
}
}
func rewriteBlock386(b *Block) bool {
- v := b.Control
switch b.Kind {
case Block386EQ:
// match: (EQ (InvertFlags cmp) yes no)
// result: (EQ cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (EQ (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -22034,304 +22035,341 @@ func rewriteBlock386(b *Block) bool {
case Block386GE:
// match: (GE (InvertFlags cmp) yes no)
// result: (LE cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case Block386GT:
// match: (GT (InvertFlags cmp) yes no)
// result: (LT cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case BlockIf:
// match: (If (SETL cmp) yes no)
// result: (LT cmp yes no)
- for v.Op == Op386SETL {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETL {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETLE cmp) yes no)
// result: (LE cmp yes no)
- for v.Op == Op386SETLE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETLE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETG cmp) yes no)
// result: (GT cmp yes no)
- for v.Op == Op386SETG {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETG {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETGE cmp) yes no)
// result: (GE cmp yes no)
- for v.Op == Op386SETGE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETGE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETEQ cmp) yes no)
// result: (EQ cmp yes no)
- for v.Op == Op386SETEQ {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETEQ {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETNE cmp) yes no)
// result: (NE cmp yes no)
- for v.Op == Op386SETNE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETNE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETB cmp) yes no)
// result: (ULT cmp yes no)
- for v.Op == Op386SETB {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETB {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETBE cmp) yes no)
// result: (ULE cmp yes no)
- for v.Op == Op386SETBE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETBE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETA cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == Op386SETA {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETA {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETAE cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == Op386SETAE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETAE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETO cmp) yes no)
// result: (OS cmp yes no)
- for v.Op == Op386SETO {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETO {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386OS
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETGF cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == Op386SETGF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETGF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETGEF cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == Op386SETGEF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETGEF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETEQF cmp) yes no)
// result: (EQF cmp yes no)
- for v.Op == Op386SETEQF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETEQF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386EQF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETNEF cmp) yes no)
// result: (NEF cmp yes no)
- for v.Op == Op386SETNEF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386SETNEF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386NEF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If cond yes no)
// result: (NE (TESTB cond cond) yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = Block386NE
- v0 := b.NewValue0(v.Pos, Op386TESTB, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(cond.Pos, Op386TESTB, types.TypeFlags)
v0.AddArg(cond)
v0.AddArg(cond)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case Block386LE:
// match: (LE (InvertFlags cmp) yes no)
// result: (GE cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -22339,52 +22377,54 @@ func rewriteBlock386(b *Block) bool {
case Block386LT:
// match: (LT (InvertFlags cmp) yes no)
// result: (GT cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -22392,747 +22432,815 @@ func rewriteBlock386(b *Block) bool {
case Block386NE:
// match: (NE (TESTB (SETL cmp) (SETL cmp)) yes no)
// result: (LT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETL {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETL {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETL || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETL || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETL cmp) (SETL cmp)) yes no)
// result: (LT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETL {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETL {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETL || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETL || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETLE cmp) (SETLE cmp)) yes no)
// result: (LE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETLE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETLE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETLE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETLE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETLE cmp) (SETLE cmp)) yes no)
// result: (LE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETLE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETLE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETLE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETLE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETG cmp) (SETG cmp)) yes no)
// result: (GT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETG {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETG {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETG || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETG || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETG cmp) (SETG cmp)) yes no)
// result: (GT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETG {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETG {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETG || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETG || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGE cmp) (SETGE cmp)) yes no)
// result: (GE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETGE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETGE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETGE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETGE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGE cmp) (SETGE cmp)) yes no)
// result: (GE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETGE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETGE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETGE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETGE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQ cmp) (SETEQ cmp)) yes no)
// result: (EQ cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETEQ {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETEQ {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETEQ || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETEQ || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQ cmp) (SETEQ cmp)) yes no)
// result: (EQ cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETEQ {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETEQ {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETEQ || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETEQ || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNE cmp) (SETNE cmp)) yes no)
// result: (NE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETNE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETNE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETNE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETNE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNE cmp) (SETNE cmp)) yes no)
// result: (NE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETNE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETNE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETNE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETNE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETB cmp) (SETB cmp)) yes no)
// result: (ULT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETB {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETB {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETB || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETB || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETB cmp) (SETB cmp)) yes no)
// result: (ULT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETB {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETB {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETB || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETB || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETBE cmp) (SETBE cmp)) yes no)
// result: (ULE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETBE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETBE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETBE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETBE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETBE cmp) (SETBE cmp)) yes no)
// result: (ULE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETBE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETBE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETBE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETBE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETA cmp) (SETA cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETA {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETA {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETA || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETA || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETA cmp) (SETA cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETA {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETA {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETA || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETA || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETAE cmp) (SETAE cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETAE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETAE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETAE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETAE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETAE cmp) (SETAE cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETAE {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETAE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETAE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETAE || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETO cmp) (SETO cmp)) yes no)
// result: (OS cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETO {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETO {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETO || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETO || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386OS
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETO cmp) (SETO cmp)) yes no)
// result: (OS cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETO {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETO {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETO || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETO || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386OS
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGF cmp) (SETGF cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETGF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETGF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETGF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETGF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGF cmp) (SETGF cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETGF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETGF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETGF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETGF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGEF cmp) (SETGEF cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETGEF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETGEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETGEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETGEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGEF cmp) (SETGEF cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETGEF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETGEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETGEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETGEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQF cmp) (SETEQF cmp)) yes no)
// result: (EQF cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETEQF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETEQF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETEQF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETEQF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386EQF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQF cmp) (SETEQF cmp)) yes no)
// result: (EQF cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETEQF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETEQF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETEQF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETEQF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386EQF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNEF cmp) (SETNEF cmp)) yes no)
// result: (NEF cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETNEF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETNEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETNEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETNEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386NEF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNEF cmp) (SETNEF cmp)) yes no)
// result: (NEF cmp yes no)
- for v.Op == Op386TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != Op386SETNEF {
+ for b.Controls[0].Op == Op386TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != Op386SETNEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != Op386SETNEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != Op386SETNEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = Block386NEF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (InvertFlags cmp) yes no)
// result: (NE cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case Block386UGE:
// match: (UGE (InvertFlags cmp) yes no)
// result: (ULE cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (UGE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case Block386UGT:
// match: (UGT (InvertFlags cmp) yes no)
// result: (ULT cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (UGT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case Block386ULE:
// match: (ULE (InvertFlags cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (ULE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -23140,52 +23248,54 @@ func rewriteBlock386(b *Block) bool {
case Block386ULT:
// match: (ULT (InvertFlags cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == Op386InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == Op386InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = Block386UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (ULT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == Op386FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == Op386FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == Op386FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == Op386FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
diff --git a/src/cmd/compile/internal/ssa/rewriteAMD64.go b/src/cmd/compile/internal/ssa/rewriteAMD64.go
index 055ab73b83..20443d2f48 100644
--- a/src/cmd/compile/internal/ssa/rewriteAMD64.go
+++ b/src/cmd/compile/internal/ssa/rewriteAMD64.go
@@ -58100,182 +58100,198 @@ func rewriteValueAMD64_OpZeroExt8to64_0(v *Value) bool {
}
func rewriteBlockAMD64(b *Block) bool {
config := b.Func.Config
- v := b.Control
switch b.Kind {
case BlockAMD64EQ:
// match: (EQ (TESTL (SHLL (MOVLconst [1]) x) y))
// cond: !config.nacl
// result: (UGE (BTL x y))
- for v.Op == OpAMD64TESTL {
- y := v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SHLL {
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ y := v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SHLL {
break
}
- x := v_0.Args[1]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpAMD64MOVLconst || v_0_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_0.Args[1]
+ v_0_0_0 := v_0_0.Args[0]
+ if v_0_0_0.Op != OpAMD64MOVLconst || v_0_0_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTL, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTL y (SHLL (MOVLconst [1]) x)))
// cond: !config.nacl
// result: (UGE (BTL x y))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- y := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SHLL {
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ y := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SHLL {
break
}
- x := v_1.Args[1]
- v_1_0 := v_1.Args[0]
- if v_1_0.Op != OpAMD64MOVLconst || v_1_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_1.Args[1]
+ v_0_1_0 := v_0_1.Args[0]
+ if v_0_1_0.Op != OpAMD64MOVLconst || v_0_1_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTL, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ (SHLQ (MOVQconst [1]) x) y))
// cond: !config.nacl
// result: (UGE (BTQ x y))
- for v.Op == OpAMD64TESTQ {
- y := v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SHLQ {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ y := v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SHLQ {
break
}
- x := v_0.Args[1]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpAMD64MOVQconst || v_0_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_0.Args[1]
+ v_0_0_0 := v_0_0.Args[0]
+ if v_0_0_0.Op != OpAMD64MOVQconst || v_0_0_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ y (SHLQ (MOVQconst [1]) x)))
// cond: !config.nacl
// result: (UGE (BTQ x y))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- y := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SHLQ {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ y := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SHLQ {
break
}
- x := v_1.Args[1]
- v_1_0 := v_1.Args[0]
- if v_1_0.Op != OpAMD64MOVQconst || v_1_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_1.Args[1]
+ v_0_1_0 := v_0_1.Args[0]
+ if v_0_1_0.Op != OpAMD64MOVQconst || v_0_1_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTLconst [c] x))
// cond: isUint32PowerOfTwo(c) && !config.nacl
// result: (UGE (BTLconst [log2uint32(c)] x))
- for v.Op == OpAMD64TESTLconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTLconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(isUint32PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = log2uint32(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQconst [c] x))
// cond: isUint64PowerOfTwo(c) && !config.nacl
// result: (UGE (BTQconst [log2(c)] x))
- for v.Op == OpAMD64TESTQconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(isUint64PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = log2(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ (MOVQconst [c]) x))
// cond: isUint64PowerOfTwo(c) && !config.nacl
// result: (UGE (BTQconst [log2(c)] x))
- for v.Op == OpAMD64TESTQ {
- x := v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64MOVQconst {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ x := v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64MOVQconst {
break
}
- c := v_0.AuxInt
+ c := v_0_0.AuxInt
if !(isUint64PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = log2(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ x (MOVQconst [c])))
// cond: isUint64PowerOfTwo(c) && !config.nacl
// result: (UGE (BTQconst [log2(c)] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- x := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64MOVQconst {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64MOVQconst {
break
}
- c := v_1.AuxInt
+ c := v_0_1.AuxInt
if !(isUint64PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = log2(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ z1:(SHLQconst [63] (SHRQconst [63] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHLQconst || z1.AuxInt != 63 {
break
}
@@ -58288,20 +58304,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ z2 z1:(SHLQconst [63] (SHRQconst [63] x))))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHLQconst || z1.AuxInt != 63 {
break
}
@@ -58314,19 +58332,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTL z1:(SHLLconst [31] (SHRQconst [31] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [31] x))
- for v.Op == OpAMD64TESTL {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHLLconst || z1.AuxInt != 31 {
break
}
@@ -58339,20 +58359,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTL z2 z1:(SHLLconst [31] (SHRQconst [31] x))))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [31] x))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHLLconst || z1.AuxInt != 31 {
break
}
@@ -58365,19 +58387,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ z1:(SHRQconst [63] (SHLQconst [63] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [0] x))
- for v.Op == OpAMD64TESTQ {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -58390,20 +58414,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ z2 z1:(SHRQconst [63] (SHLQconst [63] x))))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [0] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -58416,19 +58442,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTL z1:(SHRLconst [31] (SHLLconst [31] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTLconst [0] x))
- for v.Op == OpAMD64TESTL {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -58441,20 +58469,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTL z2 z1:(SHRLconst [31] (SHLLconst [31] x))))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTLconst [0] x))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -58467,19 +58497,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ z1:(SHRQconst [63] x) z2))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -58488,20 +58520,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTQ z2 z1:(SHRQconst [63] x)))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -58510,19 +58544,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTL z1:(SHRLconst [31] x) z2))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTLconst [31] x))
- for v.Op == OpAMD64TESTL {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -58531,20 +58567,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TESTL z2 z1:(SHRLconst [31] x)))
// cond: z1==z2 && !config.nacl
// result: (UGE (BTLconst [31] x))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -58553,62 +58591,65 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64UGE
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (InvertFlags cmp) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (EQ (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -58616,304 +58657,341 @@ func rewriteBlockAMD64(b *Block) bool {
case BlockAMD64GE:
// match: (GE (InvertFlags cmp) yes no)
// result: (LE cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case BlockAMD64GT:
// match: (GT (InvertFlags cmp) yes no)
// result: (LT cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case BlockIf:
// match: (If (SETL cmp) yes no)
// result: (LT cmp yes no)
- for v.Op == OpAMD64SETL {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETL {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETLE cmp) yes no)
// result: (LE cmp yes no)
- for v.Op == OpAMD64SETLE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETLE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETG cmp) yes no)
// result: (GT cmp yes no)
- for v.Op == OpAMD64SETG {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETG {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETGE cmp) yes no)
// result: (GE cmp yes no)
- for v.Op == OpAMD64SETGE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETGE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETEQ cmp) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpAMD64SETEQ {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETEQ {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETNE cmp) yes no)
// result: (NE cmp yes no)
- for v.Op == OpAMD64SETNE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETNE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETB cmp) yes no)
// result: (ULT cmp yes no)
- for v.Op == OpAMD64SETB {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETB {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETBE cmp) yes no)
// result: (ULE cmp yes no)
- for v.Op == OpAMD64SETBE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETBE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETA cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpAMD64SETA {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETA {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETAE cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpAMD64SETAE {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETAE {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETO cmp) yes no)
// result: (OS cmp yes no)
- for v.Op == OpAMD64SETO {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETO {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64OS
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETGF cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpAMD64SETGF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETGF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETGEF cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpAMD64SETGEF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETGEF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETEQF cmp) yes no)
// result: (EQF cmp yes no)
- for v.Op == OpAMD64SETEQF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETEQF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64EQF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If (SETNEF cmp) yes no)
// result: (NEF cmp yes no)
- for v.Op == OpAMD64SETNEF {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64SETNEF {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64NEF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (If cond yes no)
// result: (NE (TESTB cond cond) yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = BlockAMD64NE
- v0 := b.NewValue0(v.Pos, OpAMD64TESTB, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(cond.Pos, OpAMD64TESTB, types.TypeFlags)
v0.AddArg(cond)
v0.AddArg(cond)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockAMD64LE:
// match: (LE (InvertFlags cmp) yes no)
// result: (GE cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -58921,52 +58999,54 @@ func rewriteBlockAMD64(b *Block) bool {
case BlockAMD64LT:
// match: (LT (InvertFlags cmp) yes no)
// result: (GT cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -58974,573 +59054,634 @@ func rewriteBlockAMD64(b *Block) bool {
case BlockAMD64NE:
// match: (NE (TESTB (SETL cmp) (SETL cmp)) yes no)
// result: (LT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETL {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETL {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETL || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETL || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETL cmp) (SETL cmp)) yes no)
// result: (LT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETL {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETL {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETL || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETL || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETLE cmp) (SETLE cmp)) yes no)
// result: (LE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETLE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETLE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETLE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETLE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETLE cmp) (SETLE cmp)) yes no)
// result: (LE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETLE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETLE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETLE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETLE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETG cmp) (SETG cmp)) yes no)
// result: (GT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETG {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETG {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETG || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETG || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETG cmp) (SETG cmp)) yes no)
// result: (GT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETG {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETG {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETG || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETG || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGE cmp) (SETGE cmp)) yes no)
// result: (GE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETGE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETGE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETGE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETGE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGE cmp) (SETGE cmp)) yes no)
// result: (GE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETGE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETGE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETGE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETGE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQ cmp) (SETEQ cmp)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETEQ {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETEQ {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETEQ || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETEQ || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQ cmp) (SETEQ cmp)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETEQ {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETEQ {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETEQ || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETEQ || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNE cmp) (SETNE cmp)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETNE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETNE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETNE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETNE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNE cmp) (SETNE cmp)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETNE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETNE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETNE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETNE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETB cmp) (SETB cmp)) yes no)
// result: (ULT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETB {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETB {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETB || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETB || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETB cmp) (SETB cmp)) yes no)
// result: (ULT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETB {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETB {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETB || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETB || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETBE cmp) (SETBE cmp)) yes no)
// result: (ULE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETBE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETBE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETBE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETBE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETBE cmp) (SETBE cmp)) yes no)
// result: (ULE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETBE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETBE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETBE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETBE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETA cmp) (SETA cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETA {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETA {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETA || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETA || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETA cmp) (SETA cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETA {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETA {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETA || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETA || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETAE cmp) (SETAE cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETAE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETAE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETAE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETAE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETAE cmp) (SETAE cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETAE {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETAE {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETAE || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETAE || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETO cmp) (SETO cmp)) yes no)
// result: (OS cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETO {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETO {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETO || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETO || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64OS
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETO cmp) (SETO cmp)) yes no)
// result: (OS cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETO {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETO {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETO || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETO || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64OS
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTL (SHLL (MOVLconst [1]) x) y))
// cond: !config.nacl
// result: (ULT (BTL x y))
- for v.Op == OpAMD64TESTL {
- y := v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SHLL {
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ y := v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SHLL {
break
}
- x := v_0.Args[1]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpAMD64MOVLconst || v_0_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_0.Args[1]
+ v_0_0_0 := v_0_0.Args[0]
+ if v_0_0_0.Op != OpAMD64MOVLconst || v_0_0_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTL, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTL y (SHLL (MOVLconst [1]) x)))
// cond: !config.nacl
// result: (ULT (BTL x y))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- y := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SHLL {
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ y := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SHLL {
break
}
- x := v_1.Args[1]
- v_1_0 := v_1.Args[0]
- if v_1_0.Op != OpAMD64MOVLconst || v_1_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_1.Args[1]
+ v_0_1_0 := v_0_1.Args[0]
+ if v_0_1_0.Op != OpAMD64MOVLconst || v_0_1_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTL, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ (SHLQ (MOVQconst [1]) x) y))
// cond: !config.nacl
// result: (ULT (BTQ x y))
- for v.Op == OpAMD64TESTQ {
- y := v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SHLQ {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ y := v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SHLQ {
break
}
- x := v_0.Args[1]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpAMD64MOVQconst || v_0_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_0.Args[1]
+ v_0_0_0 := v_0_0.Args[0]
+ if v_0_0_0.Op != OpAMD64MOVQconst || v_0_0_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ y (SHLQ (MOVQconst [1]) x)))
// cond: !config.nacl
// result: (ULT (BTQ x y))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- y := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SHLQ {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ y := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SHLQ {
break
}
- x := v_1.Args[1]
- v_1_0 := v_1.Args[0]
- if v_1_0.Op != OpAMD64MOVQconst || v_1_0.AuxInt != 1 || !(!config.nacl) {
+ x := v_0_1.Args[1]
+ v_0_1_0 := v_0_1.Args[0]
+ if v_0_1_0.Op != OpAMD64MOVQconst || v_0_1_0.AuxInt != 1 || !(!config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTLconst [c] x))
// cond: isUint32PowerOfTwo(c) && !config.nacl
// result: (ULT (BTLconst [log2uint32(c)] x))
- for v.Op == OpAMD64TESTLconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTLconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(isUint32PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = log2uint32(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQconst [c] x))
// cond: isUint64PowerOfTwo(c) && !config.nacl
// result: (ULT (BTQconst [log2(c)] x))
- for v.Op == OpAMD64TESTQconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(isUint64PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = log2(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ (MOVQconst [c]) x))
// cond: isUint64PowerOfTwo(c) && !config.nacl
// result: (ULT (BTQconst [log2(c)] x))
- for v.Op == OpAMD64TESTQ {
- x := v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64MOVQconst {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ x := v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64MOVQconst {
break
}
- c := v_0.AuxInt
+ c := v_0_0.AuxInt
if !(isUint64PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = log2(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ x (MOVQconst [c])))
// cond: isUint64PowerOfTwo(c) && !config.nacl
// result: (ULT (BTQconst [log2(c)] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- x := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64MOVQconst {
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64MOVQconst {
break
}
- c := v_1.AuxInt
+ c := v_0_1.AuxInt
if !(isUint64PowerOfTwo(c) && !config.nacl) {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = log2(c)
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ z1:(SHLQconst [63] (SHRQconst [63] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHLQconst || z1.AuxInt != 63 {
break
}
@@ -59553,20 +59694,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ z2 z1:(SHLQconst [63] (SHRQconst [63] x))))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHLQconst || z1.AuxInt != 63 {
break
}
@@ -59579,19 +59722,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTL z1:(SHLLconst [31] (SHRQconst [31] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [31] x))
- for v.Op == OpAMD64TESTL {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHLLconst || z1.AuxInt != 31 {
break
}
@@ -59604,20 +59749,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTL z2 z1:(SHLLconst [31] (SHRQconst [31] x))))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [31] x))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHLLconst || z1.AuxInt != 31 {
break
}
@@ -59630,19 +59777,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ z1:(SHRQconst [63] (SHLQconst [63] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [0] x))
- for v.Op == OpAMD64TESTQ {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -59655,20 +59804,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ z2 z1:(SHRQconst [63] (SHLQconst [63] x))))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [0] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -59681,19 +59832,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTL z1:(SHRLconst [31] (SHLLconst [31] x)) z2))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTLconst [0] x))
- for v.Op == OpAMD64TESTL {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -59706,20 +59859,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTL z2 z1:(SHRLconst [31] (SHLLconst [31] x))))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTLconst [0] x))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -59732,19 +59887,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ z1:(SHRQconst [63] x) z2))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -59753,20 +59910,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTQ z2 z1:(SHRQconst [63] x)))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTQconst [63] x))
- for v.Op == OpAMD64TESTQ {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTQ {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRQconst || z1.AuxInt != 63 {
break
}
@@ -59775,19 +59934,21 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTQconst, types.TypeFlags)
v0.AuxInt = 63
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTL z1:(SHRLconst [31] x) z2))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTLconst [31] x))
- for v.Op == OpAMD64TESTL {
- z2 := v.Args[1]
- z1 := v.Args[0]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ z2 := v_0.Args[1]
+ z1 := v_0.Args[0]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -59796,20 +59957,22 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTL z2 z1:(SHRLconst [31] x)))
// cond: z1==z2 && !config.nacl
// result: (ULT (BTLconst [31] x))
- for v.Op == OpAMD64TESTL {
- _ = v.Args[1]
- z2 := v.Args[0]
- z1 := v.Args[1]
+ for b.Controls[0].Op == OpAMD64TESTL {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ z2 := v_0.Args[0]
+ z1 := v_0.Args[1]
if z1.Op != OpAMD64SHRLconst || z1.AuxInt != 31 {
break
}
@@ -59818,360 +59981,385 @@ func rewriteBlockAMD64(b *Block) bool {
break
}
b.Kind = BlockAMD64ULT
- v0 := b.NewValue0(v.Pos, OpAMD64BTLconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpAMD64BTLconst, types.TypeFlags)
v0.AuxInt = 31
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGF cmp) (SETGF cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETGF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETGF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETGF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETGF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGF cmp) (SETGF cmp)) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETGF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETGF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETGF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETGF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGEF cmp) (SETGEF cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETGEF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETGEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETGEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETGEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETGEF cmp) (SETGEF cmp)) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETGEF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETGEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETGEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETGEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQF cmp) (SETEQF cmp)) yes no)
// result: (EQF cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETEQF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETEQF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETEQF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETEQF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64EQF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETEQF cmp) (SETEQF cmp)) yes no)
// result: (EQF cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETEQF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETEQF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETEQF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETEQF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64EQF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNEF cmp) (SETNEF cmp)) yes no)
// result: (NEF cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETNEF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETNEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETNEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETNEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64NEF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (TESTB (SETNEF cmp) (SETNEF cmp)) yes no)
// result: (NEF cmp yes no)
- for v.Op == OpAMD64TESTB {
- _ = v.Args[1]
- v_0 := v.Args[0]
- if v_0.Op != OpAMD64SETNEF {
+ for b.Controls[0].Op == OpAMD64TESTB {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpAMD64SETNEF {
break
}
- cmp := v_0.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpAMD64SETNEF || cmp != v_1.Args[0] {
+ cmp := v_0_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpAMD64SETNEF || cmp != v_0_1.Args[0] {
break
}
b.Kind = BlockAMD64NEF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (InvertFlags cmp) yes no)
// result: (NE cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case BlockAMD64UGE:
// match: (UGE (InvertFlags cmp) yes no)
// result: (ULE cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (UGE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case BlockAMD64UGT:
// match: (UGT (InvertFlags cmp) yes no)
// result: (ULT cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (UGT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case BlockAMD64ULE:
// match: (ULE (InvertFlags cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (ULE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -60179,52 +60367,54 @@ func rewriteBlockAMD64(b *Block) bool {
case BlockAMD64ULT:
// match: (ULT (InvertFlags cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpAMD64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpAMD64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockAMD64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (ULT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpAMD64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpAMD64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpAMD64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpAMD64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
diff --git a/src/cmd/compile/internal/ssa/rewriteARM.go b/src/cmd/compile/internal/ssa/rewriteARM.go
index a192556059..b51799743b 100644
--- a/src/cmd/compile/internal/ssa/rewriteARM.go
+++ b/src/cmd/compile/internal/ssa/rewriteARM.go
@@ -20654,70 +20654,72 @@ func rewriteValueARM_OpZeromask_0(v *Value) bool {
}
}
func rewriteBlockARM(b *Block) bool {
- v := b.Control
switch b.Kind {
case BlockARMEQ:
// match: (EQ (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (EQ (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (InvertFlags cmp) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMEQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUB x y)) yes no)
// cond: l.Uses==1
// result: (EQ (CMP x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUB {
break
}
@@ -20727,21 +20729,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(MULS x y a)) yes no)
// cond: l.Uses==1
// result: (EQ (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULS {
break
}
@@ -20752,24 +20756,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUBconst [c] x)) yes no)
// cond: l.Uses==1
// result: (EQ (CMPconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBconst {
break
}
@@ -20779,21 +20785,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUBshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (CMPshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLL {
break
}
@@ -20804,22 +20812,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUBshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (CMPshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRL {
break
}
@@ -20830,22 +20840,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUBshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (CMPshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRA {
break
}
@@ -20856,22 +20868,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (CMPshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLLreg {
break
}
@@ -20882,22 +20896,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (CMPshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRLreg {
break
}
@@ -20908,22 +20924,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (CMPshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRAreg {
break
}
@@ -20934,22 +20952,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADD x y)) yes no)
// cond: l.Uses==1
// result: (EQ (CMN x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADD {
break
}
@@ -20959,21 +20979,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(MULA x y a)) yes no)
// cond: l.Uses==1
// result: (EQ (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULA {
break
}
@@ -20984,24 +21006,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (EQ (CMNconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDconst {
break
}
@@ -21011,21 +21035,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (CMNshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLL {
break
}
@@ -21036,22 +21062,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (CMNshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRL {
break
}
@@ -21062,22 +21090,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (CMNshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRA {
break
}
@@ -21088,22 +21118,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (CMNshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLLreg {
break
}
@@ -21114,22 +21146,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (CMNshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRLreg {
break
}
@@ -21140,22 +21174,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (CMNshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRAreg {
break
}
@@ -21166,22 +21202,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(AND x y)) yes no)
// cond: l.Uses==1
// result: (EQ (TST x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMAND {
break
}
@@ -21191,21 +21229,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ANDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (EQ (TSTconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDconst {
break
}
@@ -21215,21 +21255,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ANDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (TSTshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLL {
break
}
@@ -21240,22 +21282,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ANDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (TSTshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRL {
break
}
@@ -21266,22 +21310,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ANDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (TSTshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRA {
break
}
@@ -21292,22 +21338,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (TSTshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLLreg {
break
}
@@ -21318,22 +21366,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (TSTshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRLreg {
break
}
@@ -21344,22 +21394,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (TSTshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRAreg {
break
}
@@ -21370,22 +21422,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XOR x y)) yes no)
// cond: l.Uses==1
// result: (EQ (TEQ x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXOR {
break
}
@@ -21395,21 +21449,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XORconst [c] x)) yes no)
// cond: l.Uses==1
// result: (EQ (TEQconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORconst {
break
}
@@ -21419,21 +21475,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XORshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (TEQshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLL {
break
}
@@ -21444,22 +21502,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XORshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (TEQshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRL {
break
}
@@ -21470,22 +21530,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XORshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (EQ (TEQshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRA {
break
}
@@ -21496,22 +21558,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XORshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (TEQshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLLreg {
break
}
@@ -21522,22 +21586,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XORshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (TEQshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRLreg {
break
}
@@ -21548,22 +21614,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] l:(XORshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (EQ (TEQshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRAreg {
break
}
@@ -21574,74 +21642,78 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMEQ
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockARMGE:
// match: (GE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (InvertFlags cmp) yes no)
// result: (LE cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMLE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUB x y)) yes no)
// cond: l.Uses==1
// result: (GE (CMP x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUB {
break
}
@@ -21651,21 +21723,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(MULS x y a)) yes no)
// cond: l.Uses==1
// result: (GE (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULS {
break
}
@@ -21676,24 +21750,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUBconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GE (CMPconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBconst {
break
}
@@ -21703,21 +21779,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUBshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (CMPshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLL {
break
}
@@ -21728,22 +21806,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUBshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (CMPshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRL {
break
}
@@ -21754,22 +21834,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUBshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (CMPshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRA {
break
}
@@ -21780,22 +21862,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (CMPshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLLreg {
break
}
@@ -21806,22 +21890,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (CMPshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRLreg {
break
}
@@ -21832,22 +21918,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (CMPshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRAreg {
break
}
@@ -21858,22 +21946,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADD x y)) yes no)
// cond: l.Uses==1
// result: (GE (CMN x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADD {
break
}
@@ -21883,21 +21973,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(MULA x y a)) yes no)
// cond: l.Uses==1
// result: (GE (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULA {
break
}
@@ -21908,24 +22000,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GE (CMNconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDconst {
break
}
@@ -21935,21 +22029,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (CMNshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLL {
break
}
@@ -21960,22 +22056,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (CMNshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRL {
break
}
@@ -21986,22 +22084,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (CMNshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRA {
break
}
@@ -22012,22 +22112,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (CMNshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLLreg {
break
}
@@ -22038,22 +22140,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (CMNshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRLreg {
break
}
@@ -22064,22 +22168,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (CMNshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRAreg {
break
}
@@ -22090,22 +22196,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(AND x y)) yes no)
// cond: l.Uses==1
// result: (GE (TST x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMAND {
break
}
@@ -22115,21 +22223,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ANDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GE (TSTconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDconst {
break
}
@@ -22139,21 +22249,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ANDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (TSTshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLL {
break
}
@@ -22164,22 +22276,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ANDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (TSTshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRL {
break
}
@@ -22190,22 +22304,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ANDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (TSTshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRA {
break
}
@@ -22216,22 +22332,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (TSTshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLLreg {
break
}
@@ -22242,22 +22360,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (TSTshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRLreg {
break
}
@@ -22268,22 +22388,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (TSTshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRAreg {
break
}
@@ -22294,22 +22416,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XOR x y)) yes no)
// cond: l.Uses==1
// result: (GE (TEQ x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXOR {
break
}
@@ -22319,21 +22443,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XORconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GE (TEQconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORconst {
break
}
@@ -22343,21 +22469,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XORshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (TEQshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLL {
break
}
@@ -22368,22 +22496,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XORshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (TEQshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRL {
break
}
@@ -22394,22 +22524,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XORshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GE (TEQshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRA {
break
}
@@ -22420,22 +22552,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XORshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (TEQshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLLreg {
break
}
@@ -22446,22 +22580,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XORshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (TEQshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRLreg {
break
}
@@ -22472,22 +22608,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] l:(XORshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GE (TEQshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRAreg {
break
}
@@ -22498,75 +22636,79 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockARMGT:
// match: (GT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GT (InvertFlags cmp) yes no)
// result: (LT cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMLT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUB x y)) yes no)
// cond: l.Uses==1
// result: (GT (CMP x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUB {
break
}
@@ -22576,21 +22718,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(MULS x y a)) yes no)
// cond: l.Uses==1
// result: (GT (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULS {
break
}
@@ -22601,24 +22745,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUBconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GT (CMPconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBconst {
break
}
@@ -22628,21 +22774,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUBshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (CMPshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLL {
break
}
@@ -22653,22 +22801,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUBshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (CMPshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRL {
break
}
@@ -22679,22 +22829,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUBshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (CMPshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRA {
break
}
@@ -22705,22 +22857,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (CMPshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLLreg {
break
}
@@ -22731,22 +22885,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (CMPshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRLreg {
break
}
@@ -22757,22 +22913,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (CMPshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRAreg {
break
}
@@ -22783,22 +22941,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADD x y)) yes no)
// cond: l.Uses==1
// result: (GT (CMN x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADD {
break
}
@@ -22808,21 +22968,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GT (CMNconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDconst {
break
}
@@ -22832,21 +22994,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (CMNshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLL {
break
}
@@ -22857,22 +23021,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (CMNshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRL {
break
}
@@ -22883,22 +23049,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (CMNshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRA {
break
}
@@ -22909,22 +23077,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (CMNshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLLreg {
break
}
@@ -22935,22 +23105,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (CMNshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRLreg {
break
}
@@ -22961,22 +23133,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (CMNshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRAreg {
break
}
@@ -22987,22 +23161,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(AND x y)) yes no)
// cond: l.Uses==1
// result: (GT (TST x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMAND {
break
}
@@ -23012,21 +23188,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(MULA x y a)) yes no)
// cond: l.Uses==1
// result: (GT (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULA {
break
}
@@ -23037,24 +23215,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ANDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GT (TSTconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDconst {
break
}
@@ -23064,21 +23244,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ANDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (TSTshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLL {
break
}
@@ -23089,22 +23271,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ANDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (TSTshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRL {
break
}
@@ -23115,22 +23299,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ANDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (TSTshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRA {
break
}
@@ -23141,22 +23327,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (TSTshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLLreg {
break
}
@@ -23167,22 +23355,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (TSTshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRLreg {
break
}
@@ -23193,22 +23383,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (TSTshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRAreg {
break
}
@@ -23219,22 +23411,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XOR x y)) yes no)
// cond: l.Uses==1
// result: (GT (TEQ x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXOR {
break
}
@@ -23244,21 +23438,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XORconst [c] x)) yes no)
// cond: l.Uses==1
// result: (GT (TEQconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORconst {
break
}
@@ -23268,21 +23464,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XORshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (TEQshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLL {
break
}
@@ -23293,22 +23491,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XORshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (TEQshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRL {
break
}
@@ -23319,22 +23519,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XORshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (GT (TEQshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRA {
break
}
@@ -23345,22 +23547,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XORshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (TEQshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLLreg {
break
}
@@ -23371,22 +23575,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XORshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (TEQshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRLreg {
break
}
@@ -23397,22 +23603,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] l:(XORshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (GT (TEQshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRAreg {
break
}
@@ -23423,177 +23631,202 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMGT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockIf:
// match: (If (Equal cc) yes no)
// result: (EQ cc yes no)
- for v.Op == OpARMEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMEQ
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (NotEqual cc) yes no)
// result: (NE cc yes no)
- for v.Op == OpARMNotEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMNotEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMNE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessThan cc) yes no)
// result: (LT cc yes no)
- for v.Op == OpARMLessThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMLessThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMLT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessThanU cc) yes no)
// result: (ULT cc yes no)
- for v.Op == OpARMLessThanU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMLessThanU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMULT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessEqual cc) yes no)
// result: (LE cc yes no)
- for v.Op == OpARMLessEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMLessEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMLE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessEqualU cc) yes no)
// result: (ULE cc yes no)
- for v.Op == OpARMLessEqualU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMLessEqualU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMULE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterThan cc) yes no)
// result: (GT cc yes no)
- for v.Op == OpARMGreaterThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMGreaterThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterThanU cc) yes no)
// result: (UGT cc yes no)
- for v.Op == OpARMGreaterThanU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMGreaterThanU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMUGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterEqual cc) yes no)
// result: (GE cc yes no)
- for v.Op == OpARMGreaterEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMGreaterEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterEqualU cc) yes no)
// result: (UGE cc yes no)
- for v.Op == OpARMGreaterEqualU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARMGreaterEqualU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARMUGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If cond yes no)
// result: (NE (CMPconst [0] cond) yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(cond.Pos, OpARMCMPconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(cond)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockARMLE:
// match: (LE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LE (InvertFlags cmp) yes no)
// result: (GE cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUB x y)) yes no)
// cond: l.Uses==1
// result: (LE (CMP x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUB {
break
}
@@ -23603,21 +23836,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(MULS x y a)) yes no)
// cond: l.Uses==1
// result: (LE (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULS {
break
}
@@ -23628,24 +23863,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUBconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LE (CMPconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBconst {
break
}
@@ -23655,21 +23892,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUBshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (CMPshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLL {
break
}
@@ -23680,22 +23919,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUBshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (CMPshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRL {
break
}
@@ -23706,22 +23947,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUBshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (CMPshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRA {
break
}
@@ -23732,22 +23975,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (CMPshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLLreg {
break
}
@@ -23758,22 +24003,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (CMPshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRLreg {
break
}
@@ -23784,22 +24031,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (CMPshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRAreg {
break
}
@@ -23810,22 +24059,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADD x y)) yes no)
// cond: l.Uses==1
// result: (LE (CMN x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADD {
break
}
@@ -23835,21 +24086,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(MULA x y a)) yes no)
// cond: l.Uses==1
// result: (LE (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULA {
break
}
@@ -23860,24 +24113,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LE (CMNconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDconst {
break
}
@@ -23887,21 +24142,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (CMNshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLL {
break
}
@@ -23912,22 +24169,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (CMNshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRL {
break
}
@@ -23938,22 +24197,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (CMNshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRA {
break
}
@@ -23964,22 +24225,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (CMNshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLLreg {
break
}
@@ -23990,22 +24253,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (CMNshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRLreg {
break
}
@@ -24016,22 +24281,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (CMNshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRAreg {
break
}
@@ -24042,22 +24309,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(AND x y)) yes no)
// cond: l.Uses==1
// result: (LE (TST x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMAND {
break
}
@@ -24067,21 +24336,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ANDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LE (TSTconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDconst {
break
}
@@ -24091,21 +24362,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ANDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (TSTshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLL {
break
}
@@ -24116,22 +24389,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ANDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (TSTshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRL {
break
}
@@ -24142,22 +24417,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ANDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (TSTshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRA {
break
}
@@ -24168,22 +24445,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (TSTshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLLreg {
break
}
@@ -24194,22 +24473,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (TSTshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRLreg {
break
}
@@ -24220,22 +24501,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (TSTshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRAreg {
break
}
@@ -24246,22 +24529,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XOR x y)) yes no)
// cond: l.Uses==1
// result: (LE (TEQ x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXOR {
break
}
@@ -24271,21 +24556,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XORconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LE (TEQconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORconst {
break
}
@@ -24295,21 +24582,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XORshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (TEQshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLL {
break
}
@@ -24320,22 +24609,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XORshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (TEQshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRL {
break
}
@@ -24346,22 +24637,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XORshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LE (TEQshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRA {
break
}
@@ -24372,22 +24665,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XORshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (TEQshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLLreg {
break
}
@@ -24398,22 +24693,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XORshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (TEQshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRLreg {
break
}
@@ -24424,22 +24721,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] l:(XORshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LE (TEQshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRAreg {
break
}
@@ -24450,75 +24749,79 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockARMLT:
// match: (LT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (InvertFlags cmp) yes no)
// result: (GT cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUB x y)) yes no)
// cond: l.Uses==1
// result: (LT (CMP x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUB {
break
}
@@ -24528,21 +24831,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(MULS x y a)) yes no)
// cond: l.Uses==1
// result: (LT (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULS {
break
}
@@ -24553,24 +24858,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUBconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LT (CMPconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBconst {
break
}
@@ -24580,21 +24887,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUBshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (CMPshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLL {
break
}
@@ -24605,22 +24914,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUBshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (CMPshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRL {
break
}
@@ -24631,22 +24942,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUBshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (CMPshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRA {
break
}
@@ -24657,22 +24970,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (CMPshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLLreg {
break
}
@@ -24683,22 +24998,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (CMPshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRLreg {
break
}
@@ -24709,22 +25026,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (CMPshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRAreg {
break
}
@@ -24735,22 +25054,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADD x y)) yes no)
// cond: l.Uses==1
// result: (LT (CMN x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADD {
break
}
@@ -24760,21 +25081,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(MULA x y a)) yes no)
// cond: l.Uses==1
// result: (LT (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULA {
break
}
@@ -24785,24 +25108,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LT (CMNconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDconst {
break
}
@@ -24812,21 +25137,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (CMNshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLL {
break
}
@@ -24837,22 +25164,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (CMNshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRL {
break
}
@@ -24863,22 +25192,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (CMNshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRA {
break
}
@@ -24889,22 +25220,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (CMNshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLLreg {
break
}
@@ -24915,22 +25248,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (CMNshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRLreg {
break
}
@@ -24941,22 +25276,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (CMNshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRAreg {
break
}
@@ -24967,22 +25304,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(AND x y)) yes no)
// cond: l.Uses==1
// result: (LT (TST x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMAND {
break
}
@@ -24992,21 +25331,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ANDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LT (TSTconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDconst {
break
}
@@ -25016,21 +25357,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ANDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (TSTshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLL {
break
}
@@ -25041,22 +25384,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ANDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (TSTshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRL {
break
}
@@ -25067,22 +25412,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ANDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (TSTshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRA {
break
}
@@ -25093,22 +25440,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (TSTshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLLreg {
break
}
@@ -25119,22 +25468,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (TSTshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRLreg {
break
}
@@ -25145,22 +25496,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (TSTshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRAreg {
break
}
@@ -25171,22 +25524,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XOR x y)) yes no)
// cond: l.Uses==1
// result: (LT (TEQ x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXOR {
break
}
@@ -25196,21 +25551,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XORconst [c] x)) yes no)
// cond: l.Uses==1
// result: (LT (TEQconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORconst {
break
}
@@ -25220,21 +25577,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XORshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (TEQshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLL {
break
}
@@ -25245,22 +25604,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XORshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (TEQshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRL {
break
}
@@ -25271,22 +25632,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XORshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (LT (TEQshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRA {
break
}
@@ -25297,22 +25660,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XORshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (TEQshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLLreg {
break
}
@@ -25323,22 +25688,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XORshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (TEQshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRLreg {
break
}
@@ -25349,22 +25716,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] l:(XORshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (LT (TEQshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRAreg {
break
}
@@ -25375,233 +25744,257 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMLT
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockARMNE:
// match: (NE (CMPconst [0] (Equal cc)) yes no)
// result: (EQ cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMEQ
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (NotEqual cc)) yes no)
// result: (NE cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMNotEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMNotEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMNE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (LessThan cc)) yes no)
// result: (LT cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMLessThan {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMLessThan {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMLT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (LessThanU cc)) yes no)
// result: (ULT cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMLessThanU {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMLessThanU {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMULT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (LessEqual cc)) yes no)
// result: (LE cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMLessEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMLessEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMLE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (LessEqualU cc)) yes no)
// result: (ULE cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMLessEqualU {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMLessEqualU {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMULE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (GreaterThan cc)) yes no)
// result: (GT cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMGreaterThan {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMGreaterThan {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (GreaterThanU cc)) yes no)
// result: (UGT cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMGreaterThanU {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMGreaterThanU {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMUGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (GreaterEqual cc)) yes no)
// result: (GE cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMGreaterEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMGreaterEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (GreaterEqualU cc)) yes no)
// result: (UGE cc yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpARMGreaterEqualU {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpARMGreaterEqualU {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockARMUGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (InvertFlags cmp) yes no)
// result: (NE cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMNE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUB x y)) yes no)
// cond: l.Uses==1
// result: (NE (CMP x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUB {
break
}
@@ -25611,21 +26004,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(MULS x y a)) yes no)
// cond: l.Uses==1
// result: (NE (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULS {
break
}
@@ -25636,24 +26031,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUBconst [c] x)) yes no)
// cond: l.Uses==1
// result: (NE (CMPconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBconst {
break
}
@@ -25663,21 +26060,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUBshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (CMPshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLL {
break
}
@@ -25688,22 +26087,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUBshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (CMPshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRL {
break
}
@@ -25714,22 +26115,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUBshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (CMPshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRA {
break
}
@@ -25740,22 +26143,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUBshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (CMPshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftLLreg {
break
}
@@ -25766,22 +26171,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUBshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (CMPshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRLreg {
break
}
@@ -25792,22 +26199,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(SUBshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (CMPshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMSUBshiftRAreg {
break
}
@@ -25818,22 +26227,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMPshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADD x y)) yes no)
// cond: l.Uses==1
// result: (NE (CMN x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADD {
break
}
@@ -25843,21 +26254,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(MULA x y a)) yes no)
// cond: l.Uses==1
// result: (NE (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMMULA {
break
}
@@ -25868,24 +26281,26 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARMMUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARMMUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (NE (CMNconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDconst {
break
}
@@ -25895,21 +26310,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (CMNshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLL {
break
}
@@ -25920,22 +26337,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (CMNshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRL {
break
}
@@ -25946,22 +26365,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (CMNshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRA {
break
}
@@ -25972,22 +26393,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (CMNshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftLLreg {
break
}
@@ -25998,22 +26421,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (CMNshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRLreg {
break
}
@@ -26024,22 +26449,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ADDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (CMNshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMADDshiftRAreg {
break
}
@@ -26050,22 +26477,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMCMNshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(AND x y)) yes no)
// cond: l.Uses==1
// result: (NE (TST x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMAND {
break
}
@@ -26075,21 +26504,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ANDconst [c] x)) yes no)
// cond: l.Uses==1
// result: (NE (TSTconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDconst {
break
}
@@ -26099,21 +26530,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ANDshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (TSTshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLL {
break
}
@@ -26124,22 +26557,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ANDshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (TSTshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRL {
break
}
@@ -26150,22 +26585,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ANDshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (TSTshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRA {
break
}
@@ -26176,22 +26613,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ANDshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (TSTshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftLLreg {
break
}
@@ -26202,22 +26641,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ANDshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (TSTshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRLreg {
break
}
@@ -26228,22 +26669,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(ANDshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (TSTshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMANDshiftRAreg {
break
}
@@ -26254,22 +26697,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTSTshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XOR x y)) yes no)
// cond: l.Uses==1
// result: (NE (TEQ x y) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXOR {
break
}
@@ -26279,21 +26724,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQ, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQ, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XORconst [c] x)) yes no)
// cond: l.Uses==1
// result: (NE (TEQconst [c] x) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORconst {
break
}
@@ -26303,21 +26750,23 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XORshiftLL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (TEQshiftLL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLL {
break
}
@@ -26328,22 +26777,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XORshiftRL x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (TEQshiftRL x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRL {
break
}
@@ -26354,22 +26805,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRL, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRL, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XORshiftRA x y [c])) yes no)
// cond: l.Uses==1
// result: (NE (TEQshiftRA x y [c]) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRA {
break
}
@@ -26380,22 +26833,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRA, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRA, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XORshiftLLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (TEQshiftLLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftLLreg {
break
}
@@ -26406,22 +26861,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftLLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XORshiftRLreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (TEQshiftRLreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRLreg {
break
}
@@ -26432,22 +26889,24 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRLreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] l:(XORshiftRAreg x y z)) yes no)
// cond: l.Uses==1
// result: (NE (TEQshiftRAreg x y z) yes no)
- for v.Op == OpARMCMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARMCMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- l := v.Args[0]
+ l := v_0.Args[0]
if l.Op != OpARMXORshiftRAreg {
break
}
@@ -26458,221 +26917,230 @@ func rewriteBlockARM(b *Block) bool {
break
}
b.Kind = BlockARMNE
- v0 := b.NewValue0(v.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARMTEQshiftRAreg, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
v0.AddArg(z)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockARMUGE:
// match: (UGE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (InvertFlags cmp) yes no)
// result: (ULE cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARMUGT:
// match: (UGT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGT (InvertFlags cmp) yes no)
// result: (ULT cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARMULE:
// match: (ULE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULE (InvertFlags cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMUGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARMULT:
// match: (ULT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARMFlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARMFlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARMFlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARMFlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (InvertFlags cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpARMInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARMInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARMUGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
diff --git a/src/cmd/compile/internal/ssa/rewriteARM64.go b/src/cmd/compile/internal/ssa/rewriteARM64.go
index f6f8301853..66db390e59 100644
--- a/src/cmd/compile/internal/ssa/rewriteARM64.go
+++ b/src/cmd/compile/internal/ssa/rewriteARM64.go
@@ -33280,17 +33280,17 @@ func rewriteValueARM64_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockARM64(b *Block) bool {
- v := b.Control
switch b.Kind {
case BlockARM64EQ:
// match: (EQ (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (TSTWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -33300,21 +33300,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (TST x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -33324,21 +33326,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (TSTW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -33348,21 +33352,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (TSTconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -33372,21 +33378,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (CMNconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -33396,21 +33404,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (CMNWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -33420,21 +33430,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMN x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -33444,21 +33456,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMNW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -33468,20 +33482,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMN x y) yes no)
- for v.Op == OpARM64CMP {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMP {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -33490,20 +33506,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMNW x y) yes no)
- for v.Op == OpARM64CMPW {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMPW {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -33512,45 +33530,51 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] x) yes no)
// result: (Z x yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64Z
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] x) yes no)
// result: (ZW x yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64ZW
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
@@ -33561,24 +33585,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
@@ -33589,24 +33615,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMNW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
@@ -33617,24 +33645,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMPW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
@@ -33645,134 +33675,149 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64EQ
- v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (TSTconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBZ {ntz(c)} x yes no)
- for v.Op == OpARM64TSTconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64TSTconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.Kind = BlockARM64TBZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(c)
return true
}
// match: (EQ (TSTWconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBZ {ntz(int64(uint32(c)))} x yes no)
- for v.Op == OpARM64TSTWconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64TSTWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.Kind = BlockARM64TBZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(int64(uint32(c)))
return true
}
// match: (EQ (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (EQ (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (InvertFlags cmp) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64FGE:
// match: (FGE (InvertFlags cmp) yes no)
// result: (FLE cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64FLE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64FGT:
// match: (FGT (InvertFlags cmp) yes no)
// result: (FLT cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64FLT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64FLE:
// match: (FLE (InvertFlags cmp) yes no)
// result: (FGE cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64FGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64FLT:
// match: (FLT (InvertFlags cmp) yes no)
// result: (FGT cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64FGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
@@ -33780,11 +33825,12 @@ func rewriteBlockARM64(b *Block) bool {
// match: (GE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GE (TSTWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -33794,21 +33840,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GE (TST x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -33818,21 +33866,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GE (TSTW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -33842,21 +33892,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GE (TSTconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -33866,21 +33918,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GE (CMNconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -33890,21 +33944,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GE (CMNWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -33914,21 +33970,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GE (CMN x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -33938,21 +33996,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GE (CMNW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -33962,20 +34022,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (GE (CMN x y) yes no)
- for v.Op == OpARM64CMP {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMP {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -33984,20 +34046,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (GE (CMNW x y) yes no)
- for v.Op == OpARM64CMPW {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMPW {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -34006,21 +34070,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (GE (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
@@ -34031,24 +34097,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (GE (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
@@ -34059,24 +34127,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (GE (CMNW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
@@ -34087,24 +34157,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (GE (CMPW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
@@ -34115,88 +34187,95 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GE
- v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPWconst [0] x) yes no)
// result: (TBZ {int64(31)} x yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64TBZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = int64(31)
return true
}
// match: (GE (CMPconst [0] x) yes no)
// result: (TBZ {int64(63)} x yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64TBZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = int64(63)
return true
}
// match: (GE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (InvertFlags cmp) yes no)
// result: (LE cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
@@ -34204,11 +34283,12 @@ func rewriteBlockARM64(b *Block) bool {
// match: (GT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GT (TSTWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -34218,21 +34298,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GT (TST x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -34242,21 +34324,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GT (TSTW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -34266,21 +34350,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GT (TSTconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -34290,21 +34376,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GT (CMNconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -34314,21 +34402,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GT (CMNWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -34338,21 +34428,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GT (CMN x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -34362,21 +34454,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GT (CMNW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -34386,20 +34480,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (GT (CMN x y) yes no)
- for v.Op == OpARM64CMP {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMP {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -34408,20 +34504,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (GT (CMNW x y) yes no)
- for v.Op == OpARM64CMPW {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMPW {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -34430,21 +34528,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (GT (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
@@ -34455,24 +34555,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (GT (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
@@ -34483,24 +34585,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (GT (CMNW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
@@ -34511,24 +34615,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (GT (CMPW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
@@ -34539,201 +34645,233 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64GT
- v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GT (InvertFlags cmp) yes no)
// result: (LT cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockIf:
// match: (If (Equal cc) yes no)
// result: (EQ cc yes no)
- for v.Op == OpARM64Equal {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64Equal {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64EQ
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (NotEqual cc) yes no)
// result: (NE cc yes no)
- for v.Op == OpARM64NotEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64NotEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64NE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessThan cc) yes no)
// result: (LT cc yes no)
- for v.Op == OpARM64LessThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64LT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessThanU cc) yes no)
// result: (ULT cc yes no)
- for v.Op == OpARM64LessThanU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessThanU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64ULT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessEqual cc) yes no)
// result: (LE cc yes no)
- for v.Op == OpARM64LessEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64LE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessEqualU cc) yes no)
// result: (ULE cc yes no)
- for v.Op == OpARM64LessEqualU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessEqualU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64ULE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterThan cc) yes no)
// result: (GT cc yes no)
- for v.Op == OpARM64GreaterThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64GT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterThanU cc) yes no)
// result: (UGT cc yes no)
- for v.Op == OpARM64GreaterThanU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterThanU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64UGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterEqual cc) yes no)
// result: (GE cc yes no)
- for v.Op == OpARM64GreaterEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64GE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterEqualU cc) yes no)
// result: (UGE cc yes no)
- for v.Op == OpARM64GreaterEqualU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterEqualU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64UGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessThanF cc) yes no)
// result: (FLT cc yes no)
- for v.Op == OpARM64LessThanF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessThanF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FLT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessEqualF cc) yes no)
// result: (FLE cc yes no)
- for v.Op == OpARM64LessEqualF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessEqualF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FLE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterThanF cc) yes no)
// result: (FGT cc yes no)
- for v.Op == OpARM64GreaterThanF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterThanF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterEqualF cc) yes no)
// result: (FGE cc yes no)
- for v.Op == OpARM64GreaterEqualF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterEqualF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If cond yes no)
// result: (NZ cond yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = BlockARM64NZ
- b.SetControl(cond)
+ b.ResetControls()
+ b.AddControl(cond)
b.Aux = nil
return true
}
@@ -34741,11 +34879,12 @@ func rewriteBlockARM64(b *Block) bool {
// match: (LE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LE (TSTWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -34755,21 +34894,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LE (TST x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -34779,21 +34920,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LE (TSTW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -34803,21 +34946,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LE (TSTconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -34827,21 +34972,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LE (CMNconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -34851,21 +34998,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LE (CMNWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -34875,21 +35024,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LE (CMN x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -34899,21 +35050,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LE (CMNW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -34923,20 +35076,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (LE (CMN x y) yes no)
- for v.Op == OpARM64CMP {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMP {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -34945,20 +35100,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (LE (CMNW x y) yes no)
- for v.Op == OpARM64CMPW {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMPW {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -34967,21 +35124,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (LE (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
@@ -34992,24 +35151,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (LE (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
@@ -35020,24 +35181,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (LE (CMNW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
@@ -35048,24 +35211,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (LE (CMPW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
@@ -35076,64 +35241,67 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LE
- v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LE (InvertFlags cmp) yes no)
// result: (GE cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
@@ -35141,11 +35309,12 @@ func rewriteBlockARM64(b *Block) bool {
// match: (LT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LT (TSTWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -35155,21 +35324,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LT (TST x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -35179,21 +35350,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LT (TSTW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -35203,21 +35376,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LT (TSTconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -35227,21 +35402,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LT (CMNconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -35251,21 +35428,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LT (CMNWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -35275,21 +35454,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LT (CMN x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -35299,21 +35480,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LT (CMNW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -35323,20 +35506,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (LT (CMN x y) yes no)
- for v.Op == OpARM64CMP {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMP {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -35345,20 +35530,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (LT (CMNW x y) yes no)
- for v.Op == OpARM64CMPW {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMPW {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -35367,21 +35554,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (LT (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
@@ -35392,24 +35581,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (LT (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
@@ -35420,24 +35611,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (LT (CMNW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
@@ -35448,24 +35641,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (LT (CMPW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
@@ -35476,89 +35671,96 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64LT
- v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPWconst [0] x) yes no)
// result: (TBNZ {int64(31)} x yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64TBNZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = int64(31)
return true
}
// match: (LT (CMPconst [0] x) yes no)
// result: (TBNZ {int64(63)} x yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64TBNZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = int64(63)
return true
}
// match: (LT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (InvertFlags cmp) yes no)
// result: (GT cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
@@ -35566,11 +35768,12 @@ func rewriteBlockARM64(b *Block) bool {
// match: (NE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (TSTWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -35580,21 +35783,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (NE (TST x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -35604,21 +35809,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (NE (TSTW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
@@ -35628,21 +35835,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (TSTconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
@@ -35652,21 +35861,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (CMNconst [c] y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -35676,21 +35887,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (CMNWconst [c] y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
@@ -35700,21 +35913,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMN x y) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -35724,21 +35939,23 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMNW x y) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
@@ -35748,20 +35965,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMN x y) yes no)
- for v.Op == OpARM64CMP {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMP {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -35770,20 +35989,22 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMNW x y) yes no)
- for v.Op == OpARM64CMPW {
- _ = v.Args[1]
- x := v.Args[0]
- z := v.Args[1]
+ for b.Controls[0].Op == OpARM64CMPW {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
@@ -35792,45 +36013,51 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] x) yes no)
// result: (NZ x yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64NZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] x) yes no)
// result: (NZW x yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockARM64NZW
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMN a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
@@ -35841,24 +36068,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMP a (MUL <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
@@ -35869,24 +36098,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMNW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
@@ -35897,24 +36128,26 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMPW a (MULW <x.Type> x y)) yes no)
- for v.Op == OpARM64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpARM64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
@@ -35925,257 +36158,296 @@ func rewriteBlockARM64(b *Block) bool {
break
}
b.Kind = BlockARM64NE
- v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v0.AddArg(a)
- v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
+ v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg(x)
v1.AddArg(y)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (TSTconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBNZ {ntz(c)} x yes no)
- for v.Op == OpARM64TSTconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64TSTconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.Kind = BlockARM64TBNZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(c)
return true
}
// match: (NE (TSTWconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBNZ {ntz(int64(uint32(c)))} x yes no)
- for v.Op == OpARM64TSTWconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64TSTWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.Kind = BlockARM64TBNZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(int64(uint32(c)))
return true
}
// match: (NE (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (InvertFlags cmp) yes no)
// result: (NE cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64NZ:
// match: (NZ (Equal cc) yes no)
// result: (EQ cc yes no)
- for v.Op == OpARM64Equal {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64Equal {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64EQ
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (NotEqual cc) yes no)
// result: (NE cc yes no)
- for v.Op == OpARM64NotEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64NotEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64NE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (LessThan cc) yes no)
// result: (LT cc yes no)
- for v.Op == OpARM64LessThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64LT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (LessThanU cc) yes no)
// result: (ULT cc yes no)
- for v.Op == OpARM64LessThanU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessThanU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64ULT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (LessEqual cc) yes no)
// result: (LE cc yes no)
- for v.Op == OpARM64LessEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64LE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (LessEqualU cc) yes no)
// result: (ULE cc yes no)
- for v.Op == OpARM64LessEqualU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessEqualU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64ULE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (GreaterThan cc) yes no)
// result: (GT cc yes no)
- for v.Op == OpARM64GreaterThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64GT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (GreaterThanU cc) yes no)
// result: (UGT cc yes no)
- for v.Op == OpARM64GreaterThanU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterThanU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64UGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (GreaterEqual cc) yes no)
// result: (GE cc yes no)
- for v.Op == OpARM64GreaterEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64GE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (GreaterEqualU cc) yes no)
// result: (UGE cc yes no)
- for v.Op == OpARM64GreaterEqualU {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterEqualU {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64UGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (LessThanF cc) yes no)
// result: (FLT cc yes no)
- for v.Op == OpARM64LessThanF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessThanF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FLT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (LessEqualF cc) yes no)
// result: (FLE cc yes no)
- for v.Op == OpARM64LessEqualF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64LessEqualF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FLE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (GreaterThanF cc) yes no)
// result: (FGT cc yes no)
- for v.Op == OpARM64GreaterThanF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterThanF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (GreaterEqualF cc) yes no)
// result: (FGE cc yes no)
- for v.Op == OpARM64GreaterEqualF {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpARM64GreaterEqualF {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockARM64FGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NZ (ANDconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBNZ {ntz(c)} x yes no)
- for v.Op == OpARM64ANDconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64ANDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.Kind = BlockARM64TBNZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(c)
return true
}
// match: (NZ (MOVDconst [0]) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64MOVDconst {
- if v.AuxInt != 0 {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NZ (MOVDconst [c]) yes no)
// cond: c != 0
- // result: (First nil yes no)
- for v.Op == OpARM64MOVDconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
@@ -36183,251 +36455,263 @@ func rewriteBlockARM64(b *Block) bool {
// match: (NZW (ANDconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBNZ {ntz(int64(uint32(c)))} x yes no)
- for v.Op == OpARM64ANDconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64ANDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.Kind = BlockARM64TBNZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(int64(uint32(c)))
return true
}
// match: (NZW (MOVDconst [c]) yes no)
// cond: int32(c) == 0
- // result: (First nil no yes)
- for v.Op == OpARM64MOVDconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) == 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NZW (MOVDconst [c]) yes no)
// cond: int32(c) != 0
- // result: (First nil yes no)
- for v.Op == OpARM64MOVDconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
case BlockARM64UGE:
// match: (UGE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGE (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGE (InvertFlags cmp) yes no)
// result: (ULE cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64ULE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64UGT:
// match: (UGT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagLT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGT (FlagGT_ULT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (UGT (FlagGT_UGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (UGT (InvertFlags cmp) yes no)
// result: (ULT cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64ULT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64ULE:
// match: (ULE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULE (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULE (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULE (InvertFlags cmp) yes no)
// result: (UGE cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64UGE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
case BlockARM64ULT:
// match: (ULT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagLT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagLT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagLT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagLT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagLT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagLT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (FlagGT_ULT) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64FlagGT_ULT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64FlagGT_ULT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ULT (FlagGT_UGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpARM64FlagGT_UGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64FlagGT_UGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (ULT (InvertFlags cmp) yes no)
// result: (UGT cmp yes no)
- for v.Op == OpARM64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpARM64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockARM64UGT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
@@ -36435,38 +36719,42 @@ func rewriteBlockARM64(b *Block) bool {
// match: (Z (ANDconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBZ {ntz(c)} x yes no)
- for v.Op == OpARM64ANDconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64ANDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.Kind = BlockARM64TBZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(c)
return true
}
// match: (Z (MOVDconst [0]) yes no)
- // result: (First nil yes no)
- for v.Op == OpARM64MOVDconst {
- if v.AuxInt != 0 {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (Z (MOVDconst [c]) yes no)
// cond: c != 0
- // result: (First nil no yes)
- for v.Op == OpARM64MOVDconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -36475,40 +36763,44 @@ func rewriteBlockARM64(b *Block) bool {
// match: (ZW (ANDconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBZ {ntz(int64(uint32(c)))} x yes no)
- for v.Op == OpARM64ANDconst {
- c := v.AuxInt
- x := v.Args[0]
+ for b.Controls[0].Op == OpARM64ANDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
+ x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.Kind = BlockARM64TBZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = ntz(int64(uint32(c)))
return true
}
// match: (ZW (MOVDconst [c]) yes no)
// cond: int32(c) == 0
- // result: (First nil yes no)
- for v.Op == OpARM64MOVDconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) == 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (ZW (MOVDconst [c]) yes no)
// cond: int32(c) != 0
- // result: (First nil no yes)
- for v.Op == OpARM64MOVDconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpARM64MOVDconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS.go b/src/cmd/compile/internal/ssa/rewriteMIPS.go
index 98bb5f3168..3ae2a72457 100644
--- a/src/cmd/compile/internal/ssa/rewriteMIPS.go
+++ b/src/cmd/compile/internal/ssa/rewriteMIPS.go
@@ -8995,182 +8995,207 @@ func rewriteValueMIPS_OpZeromask_0(v *Value) bool {
}
}
func rewriteBlockMIPS(b *Block) bool {
- v := b.Control
switch b.Kind {
case BlockMIPSEQ:
// match: (EQ (FPFlagTrue cmp) yes no)
// result: (FPF cmp yes no)
- for v.Op == OpMIPSFPFlagTrue {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPSFPFlagTrue {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPSFPF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (FPFlagFalse cmp) yes no)
// result: (FPT cmp yes no)
- for v.Op == OpMIPSFPFlagFalse {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPSFPFlagFalse {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPSFPT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGT _ _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGT {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPSNE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTU _ _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTU {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPSNE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTconst _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTconst {
break
}
b.Kind = BlockMIPSNE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTUconst _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTUconst {
break
}
b.Kind = BlockMIPSNE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTzero _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTzero {
break
}
b.Kind = BlockMIPSNE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTUzero _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTUzero {
break
}
b.Kind = BlockMIPSNE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (SGTUconst [1] x) yes no)
// result: (NE x yes no)
- for v.Op == OpMIPSSGTUconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSSGTUconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSNE
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (SGTUzero x) yes no)
// result: (EQ x yes no)
- for v.Op == OpMIPSSGTUzero {
- x := v.Args[0]
+ for b.Controls[0].Op == OpMIPSSGTUzero {
+ v_0 := b.Controls[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSEQ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (SGTconst [0] x) yes no)
// result: (GEZ x yes no)
- for v.Op == OpMIPSSGTconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPSSGTconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSGEZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (SGTzero x) yes no)
// result: (LEZ x yes no)
- for v.Op == OpMIPSSGTzero {
- x := v.Args[0]
+ for b.Controls[0].Op == OpMIPSSGTzero {
+ v_0 := b.Controls[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSLEZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (MOVWconst [0]) yes no)
- // result: (First nil yes no)
- for v.Op == OpMIPSMOVWconst {
- if v.AuxInt != 0 {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (EQ (MOVWconst [c]) yes no)
// cond: c != 0
- // result: (First nil no yes)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9178,27 +9203,29 @@ func rewriteBlockMIPS(b *Block) bool {
case BlockMIPSGEZ:
// match: (GEZ (MOVWconst [c]) yes no)
// cond: int32(c) >= 0
- // result: (First nil yes no)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) >= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GEZ (MOVWconst [c]) yes no)
// cond: int32(c) < 0
- // result: (First nil no yes)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) < 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9206,27 +9233,29 @@ func rewriteBlockMIPS(b *Block) bool {
case BlockMIPSGTZ:
// match: (GTZ (MOVWconst [c]) yes no)
// cond: int32(c) > 0
- // result: (First nil yes no)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) > 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GTZ (MOVWconst [c]) yes no)
// cond: int32(c) <= 0
- // result: (First nil no yes)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) <= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9235,36 +9264,39 @@ func rewriteBlockMIPS(b *Block) bool {
// match: (If cond yes no)
// result: (NE cond yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = BlockMIPSNE
- b.SetControl(cond)
+ b.ResetControls()
+ b.AddControl(cond)
b.Aux = nil
return true
}
case BlockMIPSLEZ:
// match: (LEZ (MOVWconst [c]) yes no)
// cond: int32(c) <= 0
- // result: (First nil yes no)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) <= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LEZ (MOVWconst [c]) yes no)
// cond: int32(c) > 0
- // result: (First nil no yes)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) > 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9272,27 +9304,29 @@ func rewriteBlockMIPS(b *Block) bool {
case BlockMIPSLTZ:
// match: (LTZ (MOVWconst [c]) yes no)
// cond: int32(c) < 0
- // result: (First nil yes no)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) < 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LTZ (MOVWconst [c]) yes no)
// cond: int32(c) >= 0
- // result: (First nil no yes)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(int32(c) >= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9300,178 +9334,204 @@ func rewriteBlockMIPS(b *Block) bool {
case BlockMIPSNE:
// match: (NE (FPFlagTrue cmp) yes no)
// result: (FPT cmp yes no)
- for v.Op == OpMIPSFPFlagTrue {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPSFPFlagTrue {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPSFPT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (FPFlagFalse cmp) yes no)
// result: (FPF cmp yes no)
- for v.Op == OpMIPSFPFlagFalse {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPSFPFlagFalse {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPSFPF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGT _ _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGT {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPSEQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTU _ _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTU {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPSEQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTconst _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTconst {
break
}
b.Kind = BlockMIPSEQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTUconst _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTUconst {
break
}
b.Kind = BlockMIPSEQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTzero _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTzero {
break
}
b.Kind = BlockMIPSEQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTUzero _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPSXORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSXORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPSSGTUzero {
break
}
b.Kind = BlockMIPSEQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (SGTUconst [1] x) yes no)
// result: (EQ x yes no)
- for v.Op == OpMIPSSGTUconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPSSGTUconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSEQ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (SGTUzero x) yes no)
// result: (NE x yes no)
- for v.Op == OpMIPSSGTUzero {
- x := v.Args[0]
+ for b.Controls[0].Op == OpMIPSSGTUzero {
+ v_0 := b.Controls[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSNE
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (SGTconst [0] x) yes no)
// result: (LTZ x yes no)
- for v.Op == OpMIPSSGTconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPSSGTconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSLTZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (SGTzero x) yes no)
// result: (GTZ x yes no)
- for v.Op == OpMIPSSGTzero {
- x := v.Args[0]
+ for b.Controls[0].Op == OpMIPSSGTzero {
+ v_0 := b.Controls[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPSGTZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (MOVWconst [0]) yes no)
- // result: (First nil no yes)
- for v.Op == OpMIPSMOVWconst {
- if v.AuxInt != 0 {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NE (MOVWconst [c]) yes no)
// cond: c != 0
- // result: (First nil yes no)
- for v.Op == OpMIPSMOVWconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPSMOVWconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS64.go b/src/cmd/compile/internal/ssa/rewriteMIPS64.go
index 1be27697aa..226dc00952 100644
--- a/src/cmd/compile/internal/ssa/rewriteMIPS64.go
+++ b/src/cmd/compile/internal/ssa/rewriteMIPS64.go
@@ -9740,162 +9740,183 @@ func rewriteValueMIPS64_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockMIPS64(b *Block) bool {
- v := b.Control
switch b.Kind {
case BlockMIPS64EQ:
// match: (EQ (FPFlagTrue cmp) yes no)
// result: (FPF cmp yes no)
- for v.Op == OpMIPS64FPFlagTrue {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPS64FPFlagTrue {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPS64FPF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (FPFlagFalse cmp) yes no)
// result: (FPT cmp yes no)
- for v.Op == OpMIPS64FPFlagFalse {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPS64FPFlagFalse {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPS64FPT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGT _ _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGT {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPS64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTU _ _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGTU {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPS64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTconst _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGTconst {
break
}
b.Kind = BlockMIPS64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (XORconst [1] cmp:(SGTUconst _)) yes no)
// result: (NE cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGTUconst {
break
}
b.Kind = BlockMIPS64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (SGTUconst [1] x) yes no)
// result: (NE x yes no)
- for v.Op == OpMIPS64SGTUconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64SGTUconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPS64NE
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (SGTU x (MOVVconst [0])) yes no)
// result: (EQ x yes no)
- for v.Op == OpMIPS64SGTU {
- _ = v.Args[1]
- x := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpMIPS64MOVVconst || v_1.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPS64SGTU {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpMIPS64MOVVconst || v_0_1.AuxInt != 0 {
break
}
b.Kind = BlockMIPS64EQ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (SGTconst [0] x) yes no)
// result: (GEZ x yes no)
- for v.Op == OpMIPS64SGTconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPS64SGTconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPS64GEZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (SGT x (MOVVconst [0])) yes no)
// result: (LEZ x yes no)
- for v.Op == OpMIPS64SGT {
- _ = v.Args[1]
- x := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpMIPS64MOVVconst || v_1.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPS64SGT {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpMIPS64MOVVconst || v_0_1.AuxInt != 0 {
break
}
b.Kind = BlockMIPS64LEZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (EQ (MOVVconst [0]) yes no)
- // result: (First nil yes no)
- for v.Op == OpMIPS64MOVVconst {
- if v.AuxInt != 0 {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (EQ (MOVVconst [c]) yes no)
// cond: c != 0
- // result: (First nil no yes)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9903,27 +9924,29 @@ func rewriteBlockMIPS64(b *Block) bool {
case BlockMIPS64GEZ:
// match: (GEZ (MOVVconst [c]) yes no)
// cond: c >= 0
- // result: (First nil yes no)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c >= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GEZ (MOVVconst [c]) yes no)
// cond: c < 0
- // result: (First nil no yes)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c < 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9931,27 +9954,29 @@ func rewriteBlockMIPS64(b *Block) bool {
case BlockMIPS64GTZ:
// match: (GTZ (MOVVconst [c]) yes no)
// cond: c > 0
- // result: (First nil yes no)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c > 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GTZ (MOVVconst [c]) yes no)
// cond: c <= 0
- // result: (First nil no yes)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c <= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9960,36 +9985,39 @@ func rewriteBlockMIPS64(b *Block) bool {
// match: (If cond yes no)
// result: (NE cond yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = BlockMIPS64NE
- b.SetControl(cond)
+ b.ResetControls()
+ b.AddControl(cond)
b.Aux = nil
return true
}
case BlockMIPS64LEZ:
// match: (LEZ (MOVVconst [c]) yes no)
// cond: c <= 0
- // result: (First nil yes no)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c <= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LEZ (MOVVconst [c]) yes no)
// cond: c > 0
- // result: (First nil no yes)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c > 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -9997,27 +10025,29 @@ func rewriteBlockMIPS64(b *Block) bool {
case BlockMIPS64LTZ:
// match: (LTZ (MOVVconst [c]) yes no)
// cond: c < 0
- // result: (First nil yes no)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c < 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LTZ (MOVVconst [c]) yes no)
// cond: c >= 0
- // result: (First nil no yes)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c >= 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -10025,158 +10055,180 @@ func rewriteBlockMIPS64(b *Block) bool {
case BlockMIPS64NE:
// match: (NE (FPFlagTrue cmp) yes no)
// result: (FPT cmp yes no)
- for v.Op == OpMIPS64FPFlagTrue {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPS64FPFlagTrue {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPS64FPT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (FPFlagFalse cmp) yes no)
// result: (FPF cmp yes no)
- for v.Op == OpMIPS64FPFlagFalse {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpMIPS64FPFlagFalse {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockMIPS64FPF
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGT _ _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGT {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPS64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTU _ _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGTU {
break
}
_ = cmp.Args[1]
b.Kind = BlockMIPS64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTconst _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGTconst {
break
}
b.Kind = BlockMIPS64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (XORconst [1] cmp:(SGTUconst _)) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpMIPS64XORconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64XORconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- cmp := v.Args[0]
+ cmp := v_0.Args[0]
if cmp.Op != OpMIPS64SGTUconst {
break
}
b.Kind = BlockMIPS64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (SGTUconst [1] x) yes no)
// result: (EQ x yes no)
- for v.Op == OpMIPS64SGTUconst {
- if v.AuxInt != 1 {
+ for b.Controls[0].Op == OpMIPS64SGTUconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 1 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPS64EQ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (SGTU x (MOVVconst [0])) yes no)
// result: (NE x yes no)
- for v.Op == OpMIPS64SGTU {
- _ = v.Args[1]
- x := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpMIPS64MOVVconst || v_1.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPS64SGTU {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpMIPS64MOVVconst || v_0_1.AuxInt != 0 {
break
}
b.Kind = BlockMIPS64NE
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (SGTconst [0] x) yes no)
// result: (LTZ x yes no)
- for v.Op == OpMIPS64SGTconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPS64SGTconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- x := v.Args[0]
+ x := v_0.Args[0]
b.Kind = BlockMIPS64LTZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (SGT x (MOVVconst [0])) yes no)
// result: (GTZ x yes no)
- for v.Op == OpMIPS64SGT {
- _ = v.Args[1]
- x := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpMIPS64MOVVconst || v_1.AuxInt != 0 {
+ for b.Controls[0].Op == OpMIPS64SGT {
+ v_0 := b.Controls[0]
+ _ = v_0.Args[1]
+ x := v_0.Args[0]
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpMIPS64MOVVconst || v_0_1.AuxInt != 0 {
break
}
b.Kind = BlockMIPS64GTZ
- b.SetControl(x)
+ b.ResetControls()
+ b.AddControl(x)
b.Aux = nil
return true
}
// match: (NE (MOVVconst [0]) yes no)
- // result: (First nil no yes)
- for v.Op == OpMIPS64MOVVconst {
- if v.AuxInt != 0 {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NE (MOVVconst [c]) yes no)
// cond: c != 0
- // result: (First nil yes no)
- for v.Op == OpMIPS64MOVVconst {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpMIPS64MOVVconst {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
diff --git a/src/cmd/compile/internal/ssa/rewritePPC64.go b/src/cmd/compile/internal/ssa/rewritePPC64.go
index 4d2dfc1074..7743a2855e 100644
--- a/src/cmd/compile/internal/ssa/rewritePPC64.go
+++ b/src/cmd/compile/internal/ssa/rewritePPC64.go
@@ -26466,132 +26466,142 @@ func rewriteValuePPC64_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockPPC64(b *Block) bool {
- v := b.Control
switch b.Kind {
case BlockPPC64EQ:
// match: (EQ (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (EQ (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64EQ
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (EQ (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64EQ
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (EQ (FlagLT) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagLT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagLT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (FlagGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (EQ (InvertFlags cmp) yes no)
// result: (EQ cmp yes no)
- for v.Op == OpPPC64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpPPC64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockPPC64EQ
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (EQ (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64EQ
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (EQ (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64EQ
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (ANDCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64AND {
break
}
@@ -26601,21 +26611,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64EQ
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] z:(OR x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (ORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64OR {
break
}
@@ -26625,21 +26637,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64EQ
- v0 := b.NewValue0(v.Pos, OpPPC64ORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (XORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64XOR {
break
}
@@ -26649,96 +26663,104 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64EQ
- v0 := b.NewValue0(v.Pos, OpPPC64XORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockPPC64GE:
// match: (GE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (FlagLT) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagLT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagLT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GE (FlagGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GE (InvertFlags cmp) yes no)
// result: (LE cmp yes no)
- for v.Op == OpPPC64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpPPC64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockPPC64LE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (GE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64GE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (GE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64GE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GE (ANDCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64AND {
break
}
@@ -26748,21 +26770,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64GE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] z:(OR x y)) yes no)
// cond: z.Uses == 1
// result: (GE (ORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64OR {
break
}
@@ -26772,21 +26796,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64GE
- v0 := b.NewValue0(v.Pos, OpPPC64ORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GE (CMPconst [0] z:(XOR x y)) yes no)
// cond: z.Uses == 1
// result: (GE (XORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64XOR {
break
}
@@ -26796,97 +26822,105 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64GE
- v0 := b.NewValue0(v.Pos, OpPPC64XORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockPPC64GT:
// match: (GT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagLT) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagLT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagLT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (GT (FlagGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (GT (InvertFlags cmp) yes no)
// result: (LT cmp yes no)
- for v.Op == OpPPC64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpPPC64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockPPC64LT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (GT (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64GT
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (GT (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64GT
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GT (ANDCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64AND {
break
}
@@ -26896,21 +26930,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64GT
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] z:(OR x y)) yes no)
// cond: z.Uses == 1
// result: (GT (ORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64OR {
break
}
@@ -26920,21 +26956,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64GT
- v0 := b.NewValue0(v.Pos, OpPPC64ORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (GT (CMPconst [0] z:(XOR x y)) yes no)
// cond: z.Uses == 1
// result: (GT (XORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64XOR {
break
}
@@ -26944,199 +26982,228 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64GT
- v0 := b.NewValue0(v.Pos, OpPPC64XORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockIf:
// match: (If (Equal cc) yes no)
// result: (EQ cc yes no)
- for v.Op == OpPPC64Equal {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64Equal {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64EQ
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (NotEqual cc) yes no)
// result: (NE cc yes no)
- for v.Op == OpPPC64NotEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64NotEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64NE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessThan cc) yes no)
// result: (LT cc yes no)
- for v.Op == OpPPC64LessThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64LessThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64LT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (LessEqual cc) yes no)
// result: (LE cc yes no)
- for v.Op == OpPPC64LessEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64LessEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64LE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterThan cc) yes no)
// result: (GT cc yes no)
- for v.Op == OpPPC64GreaterThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64GreaterThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64GT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (GreaterEqual cc) yes no)
// result: (GE cc yes no)
- for v.Op == OpPPC64GreaterEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64GreaterEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64GE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (FLessThan cc) yes no)
// result: (FLT cc yes no)
- for v.Op == OpPPC64FLessThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64FLessThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64FLT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (FLessEqual cc) yes no)
// result: (FLE cc yes no)
- for v.Op == OpPPC64FLessEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64FLessEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64FLE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (FGreaterThan cc) yes no)
// result: (FGT cc yes no)
- for v.Op == OpPPC64FGreaterThan {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64FGreaterThan {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64FGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If (FGreaterEqual cc) yes no)
// result: (FGE cc yes no)
- for v.Op == OpPPC64FGreaterEqual {
- cc := v.Args[0]
+ for b.Controls[0].Op == OpPPC64FGreaterEqual {
+ v_0 := b.Controls[0]
+ cc := v_0.Args[0]
b.Kind = BlockPPC64FGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (If cond yes no)
// result: (NE (CMPWconst [0] cond) yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(cond.Pos, OpPPC64CMPWconst, types.TypeFlags)
v0.AuxInt = 0
v0.AddArg(cond)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockPPC64LE:
// match: (LE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagLT) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagLT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagLT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LE (FlagGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LE (InvertFlags cmp) yes no)
// result: (GE cmp yes no)
- for v.Op == OpPPC64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpPPC64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockPPC64GE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (LE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64LE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (LE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64LE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LE (ANDCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64AND {
break
}
@@ -27146,21 +27213,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64LE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] z:(OR x y)) yes no)
// cond: z.Uses == 1
// result: (LE (ORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64OR {
break
}
@@ -27170,21 +27239,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64LE
- v0 := b.NewValue0(v.Pos, OpPPC64ORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LE (CMPconst [0] z:(XOR x y)) yes no)
// cond: z.Uses == 1
// result: (LE (XORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64XOR {
break
}
@@ -27194,97 +27265,105 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64LE
- v0 := b.NewValue0(v.Pos, OpPPC64XORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockPPC64LT:
// match: (LT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (FlagLT) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagLT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagLT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (LT (FlagGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (LT (InvertFlags cmp) yes no)
// result: (GT cmp yes no)
- for v.Op == OpPPC64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpPPC64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockPPC64GT
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (LT (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64LT
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (LT (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64LT
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LT (ANDCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64AND {
break
}
@@ -27294,21 +27373,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64LT
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] z:(OR x y)) yes no)
// cond: z.Uses == 1
// result: (LT (ORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64OR {
break
}
@@ -27318,21 +27399,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64LT
- v0 := b.NewValue0(v.Pos, OpPPC64ORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (LT (CMPconst [0] z:(XOR x y)) yes no)
// cond: z.Uses == 1
// result: (LT (XORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64XOR {
break
}
@@ -27342,296 +27425,328 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64LT
- v0 := b.NewValue0(v.Pos, OpPPC64XORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
case BlockPPC64NE:
// match: (NE (CMPWconst [0] (Equal cc)) yes no)
// result: (EQ cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64Equal {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64Equal {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64EQ
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (NotEqual cc)) yes no)
// result: (NE cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64NotEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64NotEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64NE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (LessThan cc)) yes no)
// result: (LT cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64LessThan {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64LessThan {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64LT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (LessEqual cc)) yes no)
// result: (LE cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64LessEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64LessEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64LE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (GreaterThan cc)) yes no)
// result: (GT cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64GreaterThan {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64GreaterThan {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64GT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (GreaterEqual cc)) yes no)
// result: (GE cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64GreaterEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64GreaterEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64GE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (FLessThan cc)) yes no)
// result: (FLT cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64FLessThan {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64FLessThan {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64FLT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (FLessEqual cc)) yes no)
// result: (FLE cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64FLessEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64FLessEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64FLE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (FGreaterThan cc)) yes no)
// result: (FGT cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64FGreaterThan {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64FGreaterThan {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64FGT
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (FGreaterEqual cc)) yes no)
// result: (FGE cc yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64FGreaterEqual {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64FGreaterEqual {
break
}
- cc := v_0.Args[0]
+ cc := v_0_0.Args[0]
b.Kind = BlockPPC64FGE
- b.SetControl(cc)
+ b.ResetControls()
+ b.AddControl(cc)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (NE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (NE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpPPC64FlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpPPC64FlagEQ {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (NE (FlagLT) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagLT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagLT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (FlagGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpPPC64FlagGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpPPC64FlagGT {
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (NE (InvertFlags cmp) yes no)
// result: (NE cmp yes no)
- for v.Op == OpPPC64InvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpPPC64InvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
b.Kind = BlockPPC64NE
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] (ANDconst [c] x)) yes no)
// result: (NE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPWconst [0] (ANDconst [c] x)) yes no)
// result: (NE (ANDCCconst [c] x) yes no)
- for v.Op == OpPPC64CMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpPPC64ANDconst {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpPPC64ANDconst {
break
}
- c := v_0.AuxInt
- x := v_0.Args[0]
+ c := v_0_0.AuxInt
+ x := v_0_0.Args[0]
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCCconst, types.TypeFlags)
v0.AuxInt = c
v0.AddArg(x)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (NE (ANDCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64AND {
break
}
@@ -27641,21 +27756,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] z:(OR x y)) yes no)
// cond: z.Uses == 1
// result: (NE (ORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64OR {
break
}
@@ -27665,21 +27782,23 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64ORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
// match: (NE (CMPconst [0] z:(XOR x y)) yes no)
// cond: z.Uses == 1
// result: (NE (XORCC x y) yes no)
- for v.Op == OpPPC64CMPconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpPPC64CMPconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- z := v.Args[0]
+ z := v_0.Args[0]
if z.Op != OpPPC64XOR {
break
}
@@ -27689,10 +27808,11 @@ func rewriteBlockPPC64(b *Block) bool {
break
}
b.Kind = BlockPPC64NE
- v0 := b.NewValue0(v.Pos, OpPPC64XORCC, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.TypeFlags)
v0.AddArg(x)
v0.AddArg(y)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = nil
return true
}
diff --git a/src/cmd/compile/internal/ssa/rewriteS390X.go b/src/cmd/compile/internal/ssa/rewriteS390X.go
index ac2fbf80b8..9db0cc42e9 100644
--- a/src/cmd/compile/internal/ssa/rewriteS390X.go
+++ b/src/cmd/compile/internal/ssa/rewriteS390X.go
@@ -36448,39 +36448,39 @@ func rewriteValueS390X_OpZeroExt8to64_0(v *Value) bool {
}
}
func rewriteBlockS390X(b *Block) bool {
- config := b.Func.Config
- typ := &config.Types
- v := b.Control
+ typ := &b.Func.Config.Types
switch b.Kind {
case BlockS390XBRC:
// match: (BRC {c} (CMPWconst [0] (LOCGR {d} (MOVDconst [0]) (MOVDconst [x]) cmp)) yes no)
// cond: x != 0 && c.(s390x.CCMask) == s390x.Equal
// result: (BRC {d} cmp no yes)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpS390XCMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpS390XLOCGR {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpS390XLOCGR {
break
}
- d := v_0.Aux
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
+ d := v_0_0.Aux
+ cmp := v_0_0.Args[2]
+ v_0_0_0 := v_0_0.Args[0]
+ if v_0_0_0.Op != OpS390XMOVDconst || v_0_0_0.AuxInt != 0 {
break
}
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst {
+ v_0_0_1 := v_0_0.Args[1]
+ if v_0_0_1.Op != OpS390XMOVDconst {
break
}
- x := v_0_1.AuxInt
+ x := v_0_0_1.AuxInt
c := b.Aux
if !(x != 0 && c.(s390x.CCMask) == s390x.Equal) {
break
}
b.Kind = BlockS390XBRC
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = d
b.swapSuccessors()
return true
@@ -36488,148 +36488,152 @@ func rewriteBlockS390X(b *Block) bool {
// match: (BRC {c} (CMPWconst [0] (LOCGR {d} (MOVDconst [0]) (MOVDconst [x]) cmp)) yes no)
// cond: x != 0 && c.(s390x.CCMask) == s390x.NotEqual
// result: (BRC {d} cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
+ for b.Controls[0].Op == OpS390XCMPWconst {
+ v_0 := b.Controls[0]
+ if v_0.AuxInt != 0 {
break
}
- v_0 := v.Args[0]
- if v_0.Op != OpS390XLOCGR {
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpS390XLOCGR {
break
}
- d := v_0.Aux
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
+ d := v_0_0.Aux
+ cmp := v_0_0.Args[2]
+ v_0_0_0 := v_0_0.Args[0]
+ if v_0_0_0.Op != OpS390XMOVDconst || v_0_0_0.AuxInt != 0 {
break
}
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst {
+ v_0_0_1 := v_0_0.Args[1]
+ if v_0_0_1.Op != OpS390XMOVDconst {
break
}
- x := v_0_1.AuxInt
+ x := v_0_0_1.AuxInt
c := b.Aux
if !(x != 0 && c.(s390x.CCMask) == s390x.NotEqual) {
break
}
b.Kind = BlockS390XBRC
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = d
return true
}
// match: (BRC {c} (InvertFlags cmp) yes no)
// result: (BRC {c.(s390x.CCMask).ReverseComparison()} cmp yes no)
- for v.Op == OpS390XInvertFlags {
- cmp := v.Args[0]
+ for b.Controls[0].Op == OpS390XInvertFlags {
+ v_0 := b.Controls[0]
+ cmp := v_0.Args[0]
c := b.Aux
b.Kind = BlockS390XBRC
- b.SetControl(cmp)
+ b.ResetControls()
+ b.AddControl(cmp)
b.Aux = c.(s390x.CCMask).ReverseComparison()
return true
}
// match: (BRC {c} (FlagEQ) yes no)
// cond: c.(s390x.CCMask) & s390x.Equal != 0
- // result: (First nil yes no)
- for v.Op == OpS390XFlagEQ {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpS390XFlagEQ {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Equal != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (BRC {c} (FlagLT) yes no)
// cond: c.(s390x.CCMask) & s390x.Less != 0
- // result: (First nil yes no)
- for v.Op == OpS390XFlagLT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpS390XFlagLT {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Less != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (BRC {c} (FlagGT) yes no)
// cond: c.(s390x.CCMask) & s390x.Greater != 0
- // result: (First nil yes no)
- for v.Op == OpS390XFlagGT {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpS390XFlagGT {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Greater != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (BRC {c} (FlagOV) yes no)
// cond: c.(s390x.CCMask) & s390x.Unordered != 0
- // result: (First nil yes no)
- for v.Op == OpS390XFlagOV {
+ // result: (First yes no)
+ for b.Controls[0].Op == OpS390XFlagOV {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Unordered != 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (BRC {c} (FlagEQ) yes no)
// cond: c.(s390x.CCMask) & s390x.Equal == 0
- // result: (First nil no yes)
- for v.Op == OpS390XFlagEQ {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpS390XFlagEQ {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Equal == 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (BRC {c} (FlagLT) yes no)
// cond: c.(s390x.CCMask) & s390x.Less == 0
- // result: (First nil no yes)
- for v.Op == OpS390XFlagLT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpS390XFlagLT {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Less == 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (BRC {c} (FlagGT) yes no)
// cond: c.(s390x.CCMask) & s390x.Greater == 0
- // result: (First nil no yes)
- for v.Op == OpS390XFlagGT {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpS390XFlagGT {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Greater == 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (BRC {c} (FlagOV) yes no)
// cond: c.(s390x.CCMask) & s390x.Unordered == 0
- // result: (First nil no yes)
- for v.Op == OpS390XFlagOV {
+ // result: (First no yes)
+ for b.Controls[0].Op == OpS390XFlagOV {
c := b.Aux
if !(c.(s390x.CCMask)&s390x.Unordered == 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
@@ -36638,14 +36642,15 @@ func rewriteBlockS390X(b *Block) bool {
// match: (If cond yes no)
// result: (BRC {s390x.NotEqual} (CMPWconst [0] (MOVBZreg <typ.Bool> cond)) yes no)
for {
- cond := b.Control
+ cond := b.Controls[0]
b.Kind = BlockS390XBRC
- v0 := b.NewValue0(v.Pos, OpS390XCMPWconst, types.TypeFlags)
+ b.ResetControls()
+ v0 := b.NewValue0(cond.Pos, OpS390XCMPWconst, types.TypeFlags)
v0.AuxInt = 0
- v1 := b.NewValue0(v.Pos, OpS390XMOVBZreg, typ.Bool)
+ v1 := b.NewValue0(cond.Pos, OpS390XMOVBZreg, typ.Bool)
v1.AddArg(cond)
v0.AddArg(v1)
- b.SetControl(v0)
+ b.AddControl(v0)
b.Aux = s390x.NotEqual
return true
}
diff --git a/src/cmd/compile/internal/ssa/rewritegeneric.go b/src/cmd/compile/internal/ssa/rewritegeneric.go
index be1aefbfdc..091dff60be 100644
--- a/src/cmd/compile/internal/ssa/rewritegeneric.go
+++ b/src/cmd/compile/internal/ssa/rewritegeneric.go
@@ -47407,42 +47407,45 @@ func rewriteValuegeneric_OpZeroExt8to64_0(v *Value) bool {
return false
}
func rewriteBlockgeneric(b *Block) bool {
- v := b.Control
switch b.Kind {
case BlockIf:
// match: (If (Not cond) yes no)
// result: (If cond no yes)
- for v.Op == OpNot {
- cond := v.Args[0]
+ for b.Controls[0].Op == OpNot {
+ v_0 := b.Controls[0]
+ cond := v_0.Args[0]
b.Kind = BlockIf
- b.SetControl(cond)
+ b.ResetControls()
+ b.AddControl(cond)
b.Aux = nil
b.swapSuccessors()
return true
}
// match: (If (ConstBool [c]) yes no)
// cond: c == 1
- // result: (First nil yes no)
- for v.Op == OpConstBool {
- c := v.AuxInt
+ // result: (First yes no)
+ for b.Controls[0].Op == OpConstBool {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c == 1) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
return true
}
// match: (If (ConstBool [c]) yes no)
// cond: c == 0
- // result: (First nil no yes)
- for v.Op == OpConstBool {
- c := v.AuxInt
+ // result: (First no yes)
+ for b.Controls[0].Op == OpConstBool {
+ v_0 := b.Controls[0]
+ c := v_0.AuxInt
if !(c == 0) {
break
}
b.Kind = BlockFirst
- b.SetControl(nil)
+ b.ResetControls()
b.Aux = nil
b.swapSuccessors()
return true
diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go
index ca0e82953e..ff0ef25e90 100644
--- a/src/cmd/compile/internal/ssa/schedule.go
+++ b/src/cmd/compile/internal/ssa/schedule.go
@@ -195,27 +195,31 @@ func schedule(f *Func) {
}
}
- if b.Control != nil && b.Control.Op != OpPhi && b.Control.Op != OpArg {
- // Force the control value to be scheduled at the end,
- // unless it is a phi value (which must be first).
+ for _, c := range b.ControlValues() {
+ // Force the control values to be scheduled at the end,
+ // unless they are phi values (which must be first).
// OpArg also goes first -- if it is stack it register allocates
// to a LoadReg, if it is register it is from the beginning anyway.
- score[b.Control.ID] = ScoreControl
+ if c.Op == OpPhi || c.Op == OpArg {
+ continue
+ }
+ score[c.ID] = ScoreControl
- // Schedule values dependent on the control value at the end.
+ // Schedule values dependent on the control values at the end.
// This reduces the number of register spills. We don't find
- // all values that depend on the control, just values with a
+ // all values that depend on the controls, just values with a
// direct dependency. This is cheaper and in testing there
// was no difference in the number of spills.
for _, v := range b.Values {
if v.Op != OpPhi {
for _, a := range v.Args {
- if a == b.Control {
+ if a == c {
score[v.ID] = ScoreControl
}
}
}
}
+
}
// To put things into a priority queue
diff --git a/src/cmd/compile/internal/ssa/shortcircuit.go b/src/cmd/compile/internal/ssa/shortcircuit.go
index 5bf0888043..bb2322e28a 100644
--- a/src/cmd/compile/internal/ssa/shortcircuit.go
+++ b/src/cmd/compile/internal/ssa/shortcircuit.go
@@ -32,7 +32,7 @@ func shortcircuit(f *Func) {
if p.Kind != BlockIf {
continue
}
- if p.Control != a {
+ if p.Controls[0] != a {
continue
}
if e.i == 0 {
@@ -103,7 +103,7 @@ func shortcircuitBlock(b *Block) bool {
// Look for control values of the form Copy(Not(Copy(Phi(const, ...)))).
// Those must be the only values in the b, and they each must be used only by b.
// Track the negations so that we can swap successors as needed later.
- v := b.Control
+ v := b.Controls[0]
nval := 1 // the control value
swap := false
for v.Uses == 1 && v.Block == b && (v.Op == OpCopy || v.Op == OpNot) {
diff --git a/src/cmd/compile/internal/ssa/sizeof_test.go b/src/cmd/compile/internal/ssa/sizeof_test.go
index 449788d32a..8ba6a88b66 100644
--- a/src/cmd/compile/internal/ssa/sizeof_test.go
+++ b/src/cmd/compile/internal/ssa/sizeof_test.go
@@ -23,7 +23,7 @@ func TestSizeof(t *testing.T) {
_64bit uintptr // size on 64bit platforms
}{
{Value{}, 72, 112},
- {Block{}, 152, 288},
+ {Block{}, 156, 296},
{LocalSlot{}, 32, 48},
{valState{}, 28, 40},
}
diff --git a/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts b/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts
index 1e4d35051b..2be83ce936 100644
--- a/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts
+++ b/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts
@@ -70,32 +70,24 @@
87: if a == 0 { //gdb-opt=(a,n,t)
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
86: for i, a := range hist {
diff --git a/src/cmd/compile/internal/ssa/testdata/hist.gdb-dbg.nexts b/src/cmd/compile/internal/ssa/testdata/hist.gdb-dbg.nexts
index 4fde3bcc66..72df60c76f 100644
--- a/src/cmd/compile/internal/ssa/testdata/hist.gdb-dbg.nexts
+++ b/src/cmd/compile/internal/ssa/testdata/hist.gdb-dbg.nexts
@@ -9,7 +9,7 @@ l.end.y = 4
61: sink = dx + dy //gdb-opt=(dx,dy)
63: hist := make([]int, 7) //gdb-opt=(dx/O,dy/O) // TODO sink is missing if this code is in 'test' instead of 'main'
64: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A) // TODO cannedInput/A is missing if this code is in 'test' instead of 'main'
-hist = []int = {0, 0, 0, 0, 0, 0, 0}
+hist = {array = <A>, len = 7, cap = 7}
65: if len(os.Args) > 1 {
73: scanner := bufio.NewScanner(reader)
74: for scanner.Scan() { //gdb-opt=(scanner/A)
diff --git a/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts b/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts
index 65c5d0a2ce..d3a34acf69 100644
--- a/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts
+++ b/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts
@@ -24,92 +24,74 @@ scanner = (bufio.Scanner *) <A>
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 0, 0, 0, 0, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 1
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 1, 0, 0, 0, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 1
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 2, 0, 0, 0, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 1
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 3, 0, 0, 0, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 2
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 3, 1, 0, 0, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 2
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 3, 2, 0, 0, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 2
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 3, 3, 0, 0, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 4
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 3, 3, 0, 1, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 4
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
75: s := scanner.Text()
76: i, err := strconv.ParseInt(s, 10, 64)
77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
err = {tab = 0x0, data = 0x0}
-hist = []int = {0, 3, 3, 0, 2, 0, 0}
+hist = {array = 0xc00005ae50, len = 7, cap = 7}
i = 5
81: hist = ensure(int(i), hist)
82: hist[int(i)]++
-74: for scanner.Scan() { //gdb-opt=(scanner/A)
-scanner = (bufio.Scanner *) <A>
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
a = 0
@@ -122,9 +104,7 @@ n = 0
t = 0
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
a = 3
@@ -132,9 +112,7 @@ n = 3
t = 3
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
a = 0
@@ -147,9 +125,7 @@ n = 6
t = 9
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
a = 1
@@ -157,9 +133,7 @@ n = 8
t = 17
92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
91: n += a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
90: t += i * a
-92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
86: for i, a := range hist {
87: if a == 0 { //gdb-opt=(a,n,t)
a = 0
diff --git a/src/cmd/compile/internal/ssa/tighten.go b/src/cmd/compile/internal/ssa/tighten.go
index 580a06dfde..5dfc453649 100644
--- a/src/cmd/compile/internal/ssa/tighten.go
+++ b/src/cmd/compile/internal/ssa/tighten.go
@@ -87,7 +87,7 @@ func tighten(f *Func) {
}
}
}
- if c := b.Control; c != nil {
+ for _, c := range b.ControlValues() {
if !canMove[c.ID] {
continue
}
diff --git a/src/cmd/compile/internal/ssa/trim.go b/src/cmd/compile/internal/ssa/trim.go
index 1293548aad..c930a205c1 100644
--- a/src/cmd/compile/internal/ssa/trim.go
+++ b/src/cmd/compile/internal/ssa/trim.go
@@ -4,6 +4,8 @@
package ssa
+import "cmd/internal/src"
+
// trim removes blocks with no code in them.
// These blocks were inserted to remove critical edges.
func trim(f *Func) {
@@ -15,6 +17,9 @@ func trim(f *Func) {
continue
}
+ bPos := b.Pos
+ bIsStmt := bPos.IsStmt() == src.PosIsStmt
+
// Splice b out of the graph. NOTE: `mergePhi` depends on the
// order, in which the predecessors edges are merged here.
p, i := b.Preds[0].b, b.Preds[0].i
@@ -29,6 +34,23 @@ func trim(f *Func) {
s.Preds = append(s.Preds, Edge{p, i})
}
+ // Attempt to preserve a statement boundary
+ if bIsStmt {
+ sawStmt := false
+ for _, v := range s.Values {
+ if isPoorStatementOp(v.Op) {
+ continue
+ }
+ if v.Pos.SameFileAndLine(bPos) {
+ v.Pos = v.Pos.WithIsStmt()
+ }
+ sawStmt = true
+ break
+ }
+ if !sawStmt && s.Pos.SameFileAndLine(bPos) {
+ s.Pos = s.Pos.WithIsStmt()
+ }
+ }
// If `s` had more than one predecessor, update its phi-ops to
// account for the merge.
if ns > 1 {
@@ -36,6 +58,7 @@ func trim(f *Func) {
if v.Op == OpPhi {
mergePhi(v, j, b)
}
+
}
// Remove the phi-ops from `b` if they were merged into the
// phi-ops of `s`.
diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go
index a0905eab1e..c08eba3d44 100644
--- a/src/cmd/compile/internal/ssa/value.go
+++ b/src/cmd/compile/internal/ssa/value.go
@@ -47,7 +47,7 @@ type Value struct {
// Source position
Pos src.XPos
- // Use count. Each appearance in Value.Args and Block.Control counts once.
+ // Use count. Each appearance in Value.Args and Block.Controls counts once.
Uses int32
// wasm: Value stays on the WebAssembly stack. This value will not get a "register" (WebAssembly variable)
@@ -266,6 +266,7 @@ func (v *Value) reset(op Op) {
}
// copyInto makes a new value identical to v and adds it to the end of b.
+// unlike copyIntoWithXPos this does not check for v.Pos being a statement.
func (v *Value) copyInto(b *Block) *Value {
c := b.NewValue0(v.Pos.WithNotStmt(), v.Op, v.Type) // Lose the position, this causes line number churn otherwise.
c.Aux = v.Aux
@@ -281,7 +282,14 @@ func (v *Value) copyInto(b *Block) *Value {
// copyIntoWithXPos makes a new value identical to v and adds it to the end of b.
// The supplied position is used as the position of the new value.
+// Because this is used for rematerialization, check for case that (rematerialized)
+// input to value with position 'pos' carried a statement mark, and that the supplied
+// position (of the instruction using the rematerialized value) is not marked, and
+// preserve that mark if its line matches the supplied position.
func (v *Value) copyIntoWithXPos(b *Block, pos src.XPos) *Value {
+ if v.Pos.IsStmt() == src.PosIsStmt && pos.IsStmt() != src.PosIsStmt && v.Pos.SameFileAndLine(pos) {
+ pos = pos.WithIsStmt()
+ }
c := b.NewValue0(pos, v.Op, v.Type)
c.Aux = v.Aux
c.AuxInt = v.AuxInt
diff --git a/src/cmd/compile/internal/ssa/writebarrier.go b/src/cmd/compile/internal/ssa/writebarrier.go
index 5fc0ec19f7..4c51f9c788 100644
--- a/src/cmd/compile/internal/ssa/writebarrier.go
+++ b/src/cmd/compile/internal/ssa/writebarrier.go
@@ -182,7 +182,7 @@ func writebarrier(f *Func) {
b.Pos = pos
// set up control flow for end block
- bEnd.SetControl(b.Control)
+ bEnd.CopyControls(b)
bEnd.Likely = b.Likely
for _, e := range b.Succs {
bEnd.Succs = append(bEnd.Succs, e)
diff --git a/src/cmd/compile/internal/wasm/ssa.go b/src/cmd/compile/internal/wasm/ssa.go
index 8584fca9be..75b306e168 100644
--- a/src/cmd/compile/internal/wasm/ssa.go
+++ b/src/cmd/compile/internal/wasm/ssa.go
@@ -78,20 +78,20 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
switch next {
case b.Succs[0].Block():
// if false, jump to b.Succs[1]
- getValue32(s, b.Control)
+ getValue32(s, b.Controls[0])
s.Prog(wasm.AI32Eqz)
s.Prog(wasm.AIf)
s.Br(obj.AJMP, b.Succs[1].Block())
s.Prog(wasm.AEnd)
case b.Succs[1].Block():
// if true, jump to b.Succs[0]
- getValue32(s, b.Control)
+ getValue32(s, b.Controls[0])
s.Prog(wasm.AIf)
s.Br(obj.AJMP, b.Succs[0].Block())
s.Prog(wasm.AEnd)
default:
// if true, jump to b.Succs[0], else jump to b.Succs[1]
- getValue32(s, b.Control)
+ getValue32(s, b.Controls[0])
s.Prog(wasm.AIf)
s.Br(obj.AJMP, b.Succs[0].Block())
s.Prog(wasm.AEnd)
diff --git a/src/cmd/compile/internal/x86/ssa.go b/src/cmd/compile/internal/x86/ssa.go
index 66c7b753c6..603903ba48 100644
--- a/src/cmd/compile/internal/x86/ssa.go
+++ b/src/cmd/compile/internal/x86/ssa.go
@@ -18,8 +18,8 @@ import (
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
func ssaMarkMoves(s *gc.SSAGenState, b *ssa.Block) {
flive := b.FlagsLiveAtEnd
- if b.Control != nil && b.Control.Type.IsFlags() {
- flive = true
+ for _, c := range b.ControlValues() {
+ flive = c.Type.IsFlags() || flive
}
for i := len(b.Values) - 1; i >= 0; i-- {
v := b.Values[i]
@@ -952,6 +952,6 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
}
}
default:
- b.Fatalf("branch not implemented: %s. Control: %s", b.LongString(), b.Control.LongString())
+ b.Fatalf("branch not implemented: %s", b.LongString())
}
}
diff --git a/src/cmd/go.mod b/src/cmd/go.mod
index 19496a3c67..d8172ad2f5 100644
--- a/src/cmd/go.mod
+++ b/src/cmd/go.mod
@@ -8,5 +8,5 @@ require (
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect
- golang.org/x/tools v0.0.0-20190611154301-25a4f137592f
+ golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b
)
diff --git a/src/cmd/go.sum b/src/cmd/go.sum
index 9aa94eee7b..7c3ee7304b 100644
--- a/src/cmd/go.sum
+++ b/src/cmd/go.sum
@@ -7,14 +7,14 @@ golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1/go.mod h1:flIaEI6LNU6xOCD5P
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20190611154301-25a4f137592f h1:6awn5JC4pwVI5HiBqs7MDtRxnwV9PpO5iSA9v6P09pA=
-golang.org/x/tools v0.0.0-20190611154301-25a4f137592f/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b h1:gyG4T6EqWG9fqSgT0VbHhzp8bHbFux5mvlgz1gUkEaQ=
+golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index 847a7c5020..115eec4167 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -1022,7 +1022,6 @@
// Dir string // absolute path to cached source root directory
// Sum string // checksum for path, version (as in go.sum)
// GoModSum string // checksum for go.mod (as in go.sum)
-// Latest bool // would @latest resolve to this version?
// }
//
// See 'go help modules' for more about module queries.
diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go
index f7d80ff6dc..5f4bf4e6c8 100644
--- a/src/cmd/go/internal/clean/clean.go
+++ b/src/cmd/go/internal/clean/clean.go
@@ -102,7 +102,7 @@ func init() {
// mentioned explicitly in the docs but they
// are part of the build flags.
- work.AddBuildFlags(CmdClean)
+ work.AddBuildFlags(CmdClean, work.DefaultBuildFlags)
}
func runClean(cmd *base.Command, args []string) {
diff --git a/src/cmd/go/internal/generate/generate.go b/src/cmd/go/internal/generate/generate.go
index f2ae80e5dc..198ca1c1b9 100644
--- a/src/cmd/go/internal/generate/generate.go
+++ b/src/cmd/go/internal/generate/generate.go
@@ -149,7 +149,7 @@ var (
)
func init() {
- work.AddBuildFlags(CmdGenerate)
+ work.AddBuildFlags(CmdGenerate, work.DefaultBuildFlags)
CmdGenerate.Flag.StringVar(&generateRunFlag, "run", "", "")
}
diff --git a/src/cmd/go/internal/get/get.go b/src/cmd/go/internal/get/get.go
index e4945fe144..44fd316f35 100644
--- a/src/cmd/go/internal/get/get.go
+++ b/src/cmd/go/internal/get/get.go
@@ -108,7 +108,7 @@ var (
)
func init() {
- work.AddBuildFlags(CmdGet)
+ work.AddBuildFlags(CmdGet, work.OmitModFlag)
CmdGet.Run = runGet // break init loop
CmdGet.Flag.BoolVar(&Insecure, "insecure", Insecure, "")
}
diff --git a/src/cmd/go/internal/get/path.go b/src/cmd/go/internal/get/path.go
index 67d7b8a47c..95169fa5f1 100644
--- a/src/cmd/go/internal/get/path.go
+++ b/src/cmd/go/internal/get/path.go
@@ -44,9 +44,6 @@ func checkPath(path string, fileName bool) error {
if path[0] == '-' {
return fmt.Errorf("leading dash")
}
- if strings.Contains(path, "..") {
- return fmt.Errorf("double dot")
- }
if strings.Contains(path, "//") {
return fmt.Errorf("double slash")
}
diff --git a/src/cmd/go/internal/list/list.go b/src/cmd/go/internal/list/list.go
index a5f1abe64a..67819939e6 100644
--- a/src/cmd/go/internal/list/list.go
+++ b/src/cmd/go/internal/list/list.go
@@ -287,7 +287,7 @@ For more about modules, see 'go help modules'.
func init() {
CmdList.Run = runList // break init cycle
- work.AddBuildFlags(CmdList)
+ work.AddBuildFlags(CmdList, work.DefaultBuildFlags)
}
var (
diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
index b8cd36f1da..115bc29694 100644
--- a/src/cmd/go/internal/load/pkg.go
+++ b/src/cmd/go/internal/load/pkg.go
@@ -1391,26 +1391,51 @@ var cgoSyscallExclude = map[string]bool{
var foldPath = make(map[string]string)
-// DefaultExecName returns the default executable name
-// for a package with the import path importPath.
+// exeFromImportPath returns an executable name
+// for a package using the import path.
//
-// The default executable name is the last element of the import path.
+// The executable name is the last element of the import path.
// In module-aware mode, an additional rule is used on import paths
// consisting of two or more path elements. If the last element is
// a vN path element specifying the major version, then the
// second last element of the import path is used instead.
-func DefaultExecName(importPath string) string {
- _, elem := pathpkg.Split(importPath)
+func (p *Package) exeFromImportPath() string {
+ _, elem := pathpkg.Split(p.ImportPath)
if cfg.ModulesEnabled {
// If this is example.com/mycmd/v2, it's more useful to
// install it as mycmd than as v2. See golang.org/issue/24667.
- if elem != importPath && isVersionElement(elem) {
- _, elem = pathpkg.Split(pathpkg.Dir(importPath))
+ if elem != p.ImportPath && isVersionElement(elem) {
+ _, elem = pathpkg.Split(pathpkg.Dir(p.ImportPath))
}
}
return elem
}
+// exeFromFiles returns an executable name for a package
+// using the first element in GoFiles or CgoFiles collections without the prefix.
+//
+// Returns empty string in case of empty collection.
+func (p *Package) exeFromFiles() string {
+ var src string
+ if len(p.GoFiles) > 0 {
+ src = p.GoFiles[0]
+ } else if len(p.CgoFiles) > 0 {
+ src = p.CgoFiles[0]
+ } else {
+ return ""
+ }
+ _, elem := filepath.Split(src)
+ return elem[:len(elem)-len(".go")]
+}
+
+// DefaultExecName returns the default executable name for a package
+func (p *Package) DefaultExecName() string {
+ if p.Internal.CmdlineFiles {
+ return p.exeFromFiles()
+ }
+ return p.exeFromImportPath()
+}
+
// load populates p using information from bp, err, which should
// be the result of calling build.Context.Import.
func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
@@ -1451,7 +1476,7 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
p.Error = &PackageError{Err: e}
return
}
- elem := DefaultExecName(p.ImportPath)
+ elem := p.DefaultExecName()
full := cfg.BuildContext.GOOS + "_" + cfg.BuildContext.GOARCH + "/" + elem
if cfg.BuildContext.GOOS != base.ToolGOOS || cfg.BuildContext.GOARCH != base.ToolGOARCH {
// Install cross-compiled binaries to subdirectories of bin.
@@ -1950,9 +1975,14 @@ func Packages(args []string) []*Package {
// cannot be loaded at all.
// The packages that fail to load will have p.Error != nil.
func PackagesAndErrors(patterns []string) []*Package {
- if len(patterns) > 0 {
- for _, p := range patterns {
- if strings.HasSuffix(p, ".go") {
+ for _, p := range patterns {
+ // Listing is only supported with all patterns referring to either:
+ // - Files that are part of the same directory.
+ // - Explicit package paths or patterns.
+ if strings.HasSuffix(p, ".go") {
+ // We need to test whether the path is an actual Go file and not a
+ // package path or pattern ending in '.go' (see golang.org/issue/34653).
+ if fi, err := os.Stat(p); err == nil && !fi.IsDir() {
return []*Package{GoFilesPackage(patterns)}
}
}
@@ -2135,11 +2165,8 @@ func GoFilesPackage(gofiles []string) *Package {
pkg.Match = gofiles
if pkg.Name == "main" {
- _, elem := filepath.Split(gofiles[0])
- exe := elem[:len(elem)-len(".go")] + cfg.ExeSuffix
- if cfg.BuildO == "" {
- cfg.BuildO = exe
- }
+ exe := pkg.DefaultExecName() + cfg.ExeSuffix
+
if cfg.GOBIN != "" {
pkg.Target = filepath.Join(cfg.GOBIN, exe)
} else if cfg.ModulesEnabled {
diff --git a/src/cmd/go/internal/load/pkg_test.go b/src/cmd/go/internal/load/pkg_test.go
index 9ddc20d050..1e59fb989c 100644
--- a/src/cmd/go/internal/load/pkg_test.go
+++ b/src/cmd/go/internal/load/pkg_test.go
@@ -5,39 +5,49 @@ import (
"testing"
)
-func TestDefaultExecName(t *testing.T) {
+func TestPkgDefaultExecName(t *testing.T) {
oldModulesEnabled := cfg.ModulesEnabled
defer func() { cfg.ModulesEnabled = oldModulesEnabled }()
for _, tt := range []struct {
in string
+ files []string
wantMod string
wantGopath string
}{
- {"example.com/mycmd", "mycmd", "mycmd"},
- {"example.com/mycmd/v0", "v0", "v0"},
- {"example.com/mycmd/v1", "v1", "v1"},
- {"example.com/mycmd/v2", "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
- {"example.com/mycmd/v3", "mycmd", "v3"}, // Semantic import versioning, use second last element in module mode.
- {"mycmd", "mycmd", "mycmd"},
- {"mycmd/v0", "v0", "v0"},
- {"mycmd/v1", "v1", "v1"},
- {"mycmd/v2", "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
- {"v0", "v0", "v0"},
- {"v1", "v1", "v1"},
- {"v2", "v2", "v2"},
+ {"example.com/mycmd", []string{}, "mycmd", "mycmd"},
+ {"example.com/mycmd/v0", []string{}, "v0", "v0"},
+ {"example.com/mycmd/v1", []string{}, "v1", "v1"},
+ {"example.com/mycmd/v2", []string{}, "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
+ {"example.com/mycmd/v3", []string{}, "mycmd", "v3"}, // Semantic import versioning, use second last element in module mode.
+ {"mycmd", []string{}, "mycmd", "mycmd"},
+ {"mycmd/v0", []string{}, "v0", "v0"},
+ {"mycmd/v1", []string{}, "v1", "v1"},
+ {"mycmd/v2", []string{}, "mycmd", "v2"}, // Semantic import versioning, use second last element in module mode.
+ {"v0", []string{}, "v0", "v0"},
+ {"v1", []string{}, "v1", "v1"},
+ {"v2", []string{}, "v2", "v2"},
+ {"command-line-arguments", []string{"output.go", "foo.go"}, "output", "output"},
} {
{
cfg.ModulesEnabled = true
- gotMod := DefaultExecName(tt.in)
+ pkg := new(Package)
+ pkg.ImportPath = tt.in
+ pkg.GoFiles = tt.files
+ pkg.Internal.CmdlineFiles = len(tt.files) > 0
+ gotMod := pkg.DefaultExecName()
if gotMod != tt.wantMod {
- t.Errorf("DefaultExecName(%q) in module mode = %v; want %v", tt.in, gotMod, tt.wantMod)
+ t.Errorf("pkg.DefaultExecName with ImportPath = %q in module mode = %v; want %v", tt.in, gotMod, tt.wantMod)
}
}
{
cfg.ModulesEnabled = false
- gotGopath := DefaultExecName(tt.in)
+ pkg := new(Package)
+ pkg.ImportPath = tt.in
+ pkg.GoFiles = tt.files
+ pkg.Internal.CmdlineFiles = len(tt.files) > 0
+ gotGopath := pkg.DefaultExecName()
if gotGopath != tt.wantGopath {
- t.Errorf("DefaultExecName(%q) in gopath mode = %v; want %v", tt.in, gotGopath, tt.wantGopath)
+ t.Errorf("pkg.DefaultExecName with ImportPath = %q in gopath mode = %v; want %v", tt.in, gotGopath, tt.wantGopath)
}
}
}
diff --git a/src/cmd/go/internal/modcmd/download.go b/src/cmd/go/internal/modcmd/download.go
index 60d0d5b6e2..0d432e9549 100644
--- a/src/cmd/go/internal/modcmd/download.go
+++ b/src/cmd/go/internal/modcmd/download.go
@@ -43,7 +43,6 @@ corresponding to this Go struct:
Dir string // absolute path to cached source root directory
Sum string // checksum for path, version (as in go.sum)
GoModSum string // checksum for go.mod (as in go.sum)
- Latest bool // would @latest resolve to this version?
}
See 'go help modules' for more about module queries.
@@ -66,7 +65,6 @@ type moduleJSON struct {
Dir string `json:",omitempty"`
Sum string `json:",omitempty"`
GoModSum string `json:",omitempty"`
- Latest bool `json:",omitempty"`
}
func runDownload(cmd *base.Command, args []string) {
@@ -105,31 +103,6 @@ func runDownload(cmd *base.Command, args []string) {
work.Add(m)
}
- latest := map[string]string{} // path → version
- if *downloadJSON {
- // We need to populate the Latest field, but if the main module depends on a
- // version newer than latest — or if the version requested on the command
- // line is itself newer than latest — that's not trivial to determine from
- // the info returned by ListModules. Instead, we issue a separate
- // ListModules request for "latest", which should be inexpensive relative to
- // downloading the modules.
- var latestArgs []string
- for _, m := range mods {
- if m.Error != "" {
- continue
- }
- latestArgs = append(latestArgs, m.Path+"@latest")
- }
-
- if len(latestArgs) > 0 {
- for _, info := range modload.ListModules(latestArgs, listU, listVersions) {
- if info.Version != "" {
- latest[info.Path] = info.Version
- }
- }
- }
- }
-
work.Do(10, func(item interface{}) {
m := item.(*moduleJSON)
var err error
@@ -160,9 +133,6 @@ func runDownload(cmd *base.Command, args []string) {
m.Error = err.Error()
return
}
- if latest[m.Path] == m.Version {
- m.Latest = true
- }
})
if *downloadJSON {
diff --git a/src/cmd/go/internal/modfetch/coderepo_test.go b/src/cmd/go/internal/modfetch/coderepo_test.go
index 1f2b95bd23..663324b3dd 100644
--- a/src/cmd/go/internal/modfetch/coderepo_test.go
+++ b/src/cmd/go/internal/modfetch/coderepo_test.go
@@ -338,10 +338,10 @@ var codeRepoTests = []codeRepoTest{
vcs: "git",
path: "gopkg.in/yaml.v2",
rev: "v2",
- version: "v2.2.3-0.20190319135612-7b8349ac747c",
- name: "7b8349ac747c6a24702b762d2c4fd9266cf4f1d6",
- short: "7b8349ac747c",
- time: time.Date(2019, 03, 19, 13, 56, 12, 0, time.UTC),
+ version: "v2.2.5-0.20191002202810-970885f01c8b",
+ name: "970885f01c8bc1fecb7ab1c8ce8e7609bda45530",
+ short: "970885f01c8b",
+ time: time.Date(2019, 10, 2, 20, 28, 10, 0, time.UTC),
gomod: "module \"gopkg.in/yaml.v2\"\n\nrequire (\n\t\"gopkg.in/check.v1\" v0.0.0-20161208181325-20d25e280405\n)\n",
},
{
diff --git a/src/cmd/go/internal/modfile/read_test.go b/src/cmd/go/internal/modfile/read_test.go
index 8cb1a3908c..32401304b9 100644
--- a/src/cmd/go/internal/modfile/read_test.go
+++ b/src/cmd/go/internal/modfile/read_test.go
@@ -363,3 +363,26 @@ func TestModulePath(t *testing.T) {
})
}
}
+
+func TestGoVersion(t *testing.T) {
+ for _, test := range []struct {
+ desc, input string
+ ok bool
+ }{
+ {desc: "empty", input: "module m\ngo \n", ok: false},
+ {desc: "one", input: "module m\ngo 1\n", ok: false},
+ {desc: "two", input: "module m\ngo 1.22\n", ok: true},
+ {desc: "three", input: "module m\ngo 1.22.333", ok: false},
+ {desc: "before", input: "module m\ngo v1.2\n", ok: false},
+ {desc: "after", input: "module m\ngo 1.2rc1\n", ok: false},
+ {desc: "space", input: "module m\ngo 1.2 3.4\n", ok: false},
+ } {
+ t.Run(test.desc, func(t *testing.T) {
+ if _, err := Parse("go.mod", []byte(test.input), nil); err == nil && !test.ok {
+ t.Error("unexpected success")
+ } else if err != nil && test.ok {
+ t.Errorf("unexpected error: %v", err)
+ }
+ })
+ }
+}
diff --git a/src/cmd/go/internal/modfile/rule.go b/src/cmd/go/internal/modfile/rule.go
index 6e1a22f3ca..e1f2687840 100644
--- a/src/cmd/go/internal/modfile/rule.go
+++ b/src/cmd/go/internal/modfile/rule.go
@@ -153,7 +153,7 @@ func parseToFile(file string, data []byte, fix VersionFixer, strict bool) (*File
return f, nil
}
-var GoVersionRE = lazyregexp.New(`([1-9][0-9]*)\.(0|[1-9][0-9]*)`)
+var GoVersionRE = lazyregexp.New(`^([1-9][0-9]*)\.(0|[1-9][0-9]*)$`)
func (f *File) add(errs *bytes.Buffer, line *Line, verb string, args []string, fix VersionFixer, strict bool) {
// If strict is false, this module is a dependency.
diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go
index 3fcd2d412a..ced5abcc71 100644
--- a/src/cmd/go/internal/modget/get.go
+++ b/src/cmd/go/internal/modget/get.go
@@ -7,7 +7,6 @@ package modget
import (
"cmd/go/internal/base"
- "cmd/go/internal/cfg"
"cmd/go/internal/get"
"cmd/go/internal/imports"
"cmd/go/internal/load"
@@ -199,7 +198,7 @@ func (v *upgradeFlag) Set(s string) error {
func (v *upgradeFlag) String() string { return "" }
func init() {
- work.AddBuildFlags(CmdGet)
+ work.AddBuildFlags(CmdGet, work.OmitModFlag)
CmdGet.Run = runGet // break init loop
CmdGet.Flag.BoolVar(&get.Insecure, "insecure", get.Insecure, "")
CmdGet.Flag.Var(&getU, "u", "")
@@ -256,11 +255,6 @@ type query struct {
}
func runGet(cmd *base.Command, args []string) {
- // -mod=readonly has no effect on "go get".
- if cfg.BuildMod == "readonly" {
- cfg.BuildMod = ""
- }
-
switch getU {
case "", "upgrade", "patch":
// ok
@@ -278,10 +272,6 @@ func runGet(cmd *base.Command, args []string) {
}
modload.LoadTests = *getT
- if cfg.BuildMod == "vendor" {
- base.Fatalf("go get: disabled by -mod=%s", cfg.BuildMod)
- }
-
buildList := modload.LoadBuildList()
buildList = buildList[:len(buildList):len(buildList)] // copy on append
versionByPath := make(map[string]string)
@@ -678,15 +668,6 @@ func runGet(cmd *base.Command, args []string) {
if *getD || len(pkgPatterns) == 0 {
return
}
- // TODO(golang.org/issue/32483): handle paths ending with ".go" consistently
- // with 'go build'. When we load packages above, we interpret arguments as
- // package patterns, not source files. To preserve that interpretation here,
- // we add a trailing slash to any patterns ending with ".go".
- for i := range pkgPatterns {
- if strings.HasSuffix(pkgPatterns[i], ".go") {
- pkgPatterns[i] += "/"
- }
- }
work.BuildInit()
pkgs := load.PackagesForBuild(pkgPatterns)
work.InstallPackages(pkgPatterns, pkgs)
diff --git a/src/cmd/go/internal/module/module.go b/src/cmd/go/internal/module/module.go
index 3d1ad27628..3b70574e23 100644
--- a/src/cmd/go/internal/module/module.go
+++ b/src/cmd/go/internal/module/module.go
@@ -231,9 +231,6 @@ func checkPath(path string, fileName bool) error {
if path[0] == '-' {
return fmt.Errorf("leading dash")
}
- if strings.Contains(path, "..") {
- return fmt.Errorf("double dot")
- }
if strings.Contains(path, "//") {
return fmt.Errorf("double slash")
}
diff --git a/src/cmd/go/internal/module/module_test.go b/src/cmd/go/internal/module/module_test.go
index b9f07bf57d..2c22ee7939 100644
--- a/src/cmd/go/internal/module/module_test.go
+++ b/src/cmd/go/internal/module/module_test.go
@@ -80,7 +80,7 @@ var checkPathTests = []struct {
{"x./z", false, false, false},
{".x/z", false, false, true},
{"-x/z", false, false, false},
- {"x..y/z", false, false, false},
+ {"x..y/z", true, true, true},
{"x.y/z/../../w", false, false, false},
{"x.y//z", false, false, false},
{"x.y/z//w", false, false, false},
@@ -173,6 +173,7 @@ var checkPathTests = []struct {
// When we do, we'll enable them everywhere, not just for GitHub.
{"github.com/user/unicode/испытание", false, false, true},
+ {".../x", false, false, false},
{"../x", false, false, false},
{"./y", false, false, false},
{"x:y", false, false, false},
diff --git a/src/cmd/go/internal/run/run.go b/src/cmd/go/internal/run/run.go
index 71da5adc93..648a87f665 100644
--- a/src/cmd/go/internal/run/run.go
+++ b/src/cmd/go/internal/run/run.go
@@ -49,7 +49,7 @@ See also: go build.
func init() {
CmdRun.Run = runRun // break init loop
- work.AddBuildFlags(CmdRun)
+ work.AddBuildFlags(CmdRun, work.DefaultBuildFlags)
CmdRun.Flag.Var((*base.StringsFlag)(&work.ExecCmd), "exec", "")
}
diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go
index 8141e31c99..fb011d4c03 100644
--- a/src/cmd/go/internal/test/test.go
+++ b/src/cmd/go/internal/test/test.go
@@ -829,7 +829,7 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin
if p.ImportPath == "command-line-arguments" {
elem = p.Name
} else {
- elem = load.DefaultExecName(p.ImportPath)
+ elem = p.DefaultExecName()
}
testBinary := elem + ".test"
diff --git a/src/cmd/go/internal/test/testflag.go b/src/cmd/go/internal/test/testflag.go
index 138e1f9d2a..79dc5eb2a0 100644
--- a/src/cmd/go/internal/test/testflag.go
+++ b/src/cmd/go/internal/test/testflag.go
@@ -65,7 +65,7 @@ var testFlagDefn = []*cmdflag.Defn{
func init() {
cmdflag.AddKnownFlags("test", testFlagDefn)
var cmd base.Command
- work.AddBuildFlags(&cmd)
+ work.AddBuildFlags(&cmd, work.DefaultBuildFlags)
cmd.Flag.VisitAll(func(f *flag.Flag) {
if f.Name == "v" {
// test overrides the build -v flag
diff --git a/src/cmd/go/internal/vet/vetflag.go b/src/cmd/go/internal/vet/vetflag.go
index cbe7f8ce08..7179f73cfc 100644
--- a/src/cmd/go/internal/vet/vetflag.go
+++ b/src/cmd/go/internal/vet/vetflag.go
@@ -114,7 +114,7 @@ func vetFlags(usage func(), args []string) (passToVet, packageNames []string) {
// Add build flags to vetFlagDefn.
var cmd base.Command
- work.AddBuildFlags(&cmd)
+ work.AddBuildFlags(&cmd, work.DefaultBuildFlags)
// This flag declaration is a placeholder:
// -vettool is actually parsed by the init function above.
cmd.Flag.StringVar(new(string), "vettool", "", "path to vet tool binary")
diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
index 9d6fa0c25b..54b049b68f 100644
--- a/src/cmd/go/internal/work/build.go
+++ b/src/cmd/go/internal/work/build.go
@@ -167,8 +167,8 @@ func init() {
CmdInstall.Flag.BoolVar(&cfg.BuildI, "i", false, "")
- AddBuildFlags(CmdBuild)
- AddBuildFlags(CmdInstall)
+ AddBuildFlags(CmdBuild, DefaultBuildFlags)
+ AddBuildFlags(CmdInstall, DefaultBuildFlags)
}
// Note that flags consulted by other parts of the code
@@ -216,9 +216,16 @@ func init() {
}
}
+type BuildFlagMask int
+
+const (
+ DefaultBuildFlags BuildFlagMask = 0
+ OmitModFlag BuildFlagMask = 1 << iota
+)
+
// addBuildFlags adds the flags common to the build, clean, get,
// install, list, run, and test commands.
-func AddBuildFlags(cmd *base.Command) {
+func AddBuildFlags(cmd *base.Command, mask BuildFlagMask) {
cmd.Flag.BoolVar(&cfg.BuildA, "a", false, "")
cmd.Flag.BoolVar(&cfg.BuildN, "n", false, "")
cmd.Flag.IntVar(&cfg.BuildP, "p", cfg.BuildP, "")
@@ -230,7 +237,9 @@ func AddBuildFlags(cmd *base.Command) {
cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "")
cmd.Flag.Var(&load.BuildGcflags, "gcflags", "")
cmd.Flag.Var(&load.BuildGccgoflags, "gccgoflags", "")
- cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "")
+ if mask&OmitModFlag == 0 {
+ cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "")
+ }
cmd.Flag.StringVar(&cfg.BuildContext.InstallSuffix, "installsuffix", "", "")
cmd.Flag.Var(&load.BuildLdflags, "ldflags", "")
cmd.Flag.BoolVar(&cfg.BuildLinkshared, "linkshared", false, "")
@@ -320,7 +329,7 @@ func runBuild(cmd *base.Command, args []string) {
explicitO := len(cfg.BuildO) > 0
if len(pkgs) == 1 && pkgs[0].Name == "main" && cfg.BuildO == "" {
- cfg.BuildO = load.DefaultExecName(pkgs[0].ImportPath)
+ cfg.BuildO = pkgs[0].DefaultExecName()
cfg.BuildO += cfg.ExeSuffix
}
@@ -364,7 +373,8 @@ func runBuild(cmd *base.Command, args []string) {
if p.Name != "main" {
continue
}
- p.Target = filepath.Join(cfg.BuildO, load.DefaultExecName(p.ImportPath))
+
+ p.Target = filepath.Join(cfg.BuildO, p.DefaultExecName())
p.Target += cfg.ExeSuffix
p.Stale = true
p.StaleReason = "build -o flag in use"
@@ -586,7 +596,7 @@ func InstallPackages(patterns []string, pkgs []*load.Package) {
if len(patterns) == 0 && len(pkgs) == 1 && pkgs[0].Name == "main" {
// Compute file 'go build' would have created.
// If it exists and is an executable file, remove it.
- targ := load.DefaultExecName(pkgs[0].ImportPath)
+ targ := pkgs[0].DefaultExecName()
targ += cfg.ExeSuffix
if filepath.Join(pkgs[0].Dir, targ) != pkgs[0].Target { // maybe $GOBIN is the current directory
fi, err := os.Stat(targ)
diff --git a/src/cmd/go/testdata/script/build_multi_main.txt b/src/cmd/go/testdata/script/build_multi_main.txt
index 1d4926d979..8afd8b8a2e 100644
--- a/src/cmd/go/testdata/script/build_multi_main.txt
+++ b/src/cmd/go/testdata/script/build_multi_main.txt
@@ -10,6 +10,11 @@ stderr 'no main packages'
! go build ./cmd/c1
stderr 'already exists and is a directory'
+# Verify build -o output correctly local packages
+mkdir $WORK/local
+go build -o $WORK/local ./exec.go
+exists $WORK/local/exec$GOEXE
+
-- go.mod --
module exmod
@@ -29,5 +34,10 @@ package pkg1
-- pkg2/pkg2.go --
package pkg2
+-- exec.go --
+package main
+
+func main() {}
+
-- c1$GOEXE/keep.txt --
Create c1 directory.
diff --git a/src/cmd/go/testdata/script/list_ambiguous_path.txt b/src/cmd/go/testdata/script/list_ambiguous_path.txt
new file mode 100644
index 0000000000..9f1aa37be8
--- /dev/null
+++ b/src/cmd/go/testdata/script/list_ambiguous_path.txt
@@ -0,0 +1,37 @@
+# Ensures that we can correctly list package patterns ending in '.go'.
+# See golang.org/issue/34653.
+
+# A single pattern for a package ending in '.go'.
+go list ./foo.go
+stdout '^test/foo.go$'
+
+# Multiple patterns for packages including one ending in '.go'.
+go list ./bar ./foo.go
+stdout '^test/bar$'
+stdout '^test/foo.go$'
+
+# A single pattern for a Go file.
+go list ./a.go
+stdout '^command-line-arguments$'
+
+# A single typo-ed pattern for a Go file. This should
+# treat the wrong pattern as if it were a package.
+! go list ./foo.go/b.go
+stderr 'package ./foo.go/b.go: cannot find package "."'
+
+# Multiple patterns for Go files with a typo. This should
+# treat the wrong pattern as if it were a non-existint file.
+! go list ./foo.go/a.go ./foo.go/b.go
+[windows] stderr './foo.go/b.go: The system cannot find the file specified'
+[!windows] stderr './foo.go/b.go: no such file or directory'
+
+-- a.go --
+package main
+-- bar/a.go --
+package bar
+-- foo.go/a.go --
+package foo.go
+-- go.mod --
+module "test"
+
+go 1.13
diff --git a/src/cmd/go/testdata/script/mod_download.txt b/src/cmd/go/testdata/script/mod_download.txt
index 9eb3140c33..0777913786 100644
--- a/src/cmd/go/testdata/script/mod_download.txt
+++ b/src/cmd/go/testdata/script/mod_download.txt
@@ -17,7 +17,6 @@ stderr 'this.domain.is.invalid'
stdout '"Error": ".*this.domain.is.invalid.*"'
# download -json with version should print JSON
-# and download the .info file for the 'latest' version.
go mod download -json 'rsc.io/quote@<=v1.5.0'
stdout '^\t"Path": "rsc.io/quote"'
stdout '^\t"Version": "v1.5.0"'
@@ -28,14 +27,13 @@ stdout '^\t"Sum": "h1:6fJa6E\+wGadANKkUMlZ0DhXFpoKlslOQDCo259XtdIE="' # hash of
stdout '^\t"GoModSum": "h1:LzX7hefJvL54yjefDEDHNONDjII0t9xZLPXsUe\+TKr0="'
! stdout '"Error"'
-exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.info
-
# download queries above should not have added to go.mod.
go list -m all
! stdout rsc.io
# add to go.mod so we can test non-query downloads
go mod edit -require rsc.io/quote@v1.5.2
+! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.info
! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.mod
! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.zip
diff --git a/src/cmd/go/testdata/script/mod_download_latest.txt b/src/cmd/go/testdata/script/mod_download_latest.txt
deleted file mode 100644
index 60d860e4da..0000000000
--- a/src/cmd/go/testdata/script/mod_download_latest.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-env GO111MODULE=on
-
-# If the module is the latest version of itself,
-# the Latest field should be set.
-go mod download -json rsc.io/quote@v1.5.2
-stdout '"Latest":\s*true'
-
-# If the module is older than latest, the field should be unset.
-go mod download -json rsc.io/quote@v1.5.1
-! stdout '"Latest":'
-
-# If the module is newer than "latest", the field should be unset...
-go mod download -json rsc.io/quote@v1.5.3-pre1
-! stdout '"Latest":'
-
-# ...even if that version is also what is required by the main module.
-go mod init example.com
-go mod edit -require rsc.io/quote@v1.5.3-pre1
-go mod download -json rsc.io/quote@v1.5.3-pre1
-! stdout '"Latest":'
diff --git a/src/cmd/go/testdata/script/mod_get_trailing_slash.txt b/src/cmd/go/testdata/script/mod_get_trailing_slash.txt
index 8828738abb..7b5d90c50b 100644
--- a/src/cmd/go/testdata/script/mod_get_trailing_slash.txt
+++ b/src/cmd/go/testdata/script/mod_get_trailing_slash.txt
@@ -1,8 +1,9 @@
-# go list should fail to load a package ending with ".go" since that denotes
-# a source file. However, ".go/" should work.
-# TODO(golang.org/issue/32483): perhaps we should treat non-existent paths
-# with .go suffixes as package paths instead.
-! go list example.com/dotgo.go
+# go list should succeed to load a package ending with ".go" if the path does
+# not correspond to an existing local file. Listing a pattern ending with
+# ".go/" should try to list a package regardless of whether a file exists at the
+# path without the suffixed "/" or not.
+go list example.com/dotgo.go
+stdout ^example.com/dotgo.go$
go list example.com/dotgo.go/
stdout ^example.com/dotgo.go$
@@ -15,9 +16,6 @@ go get -d example.com/dotgo.go@v1.0.0
go get -d example.com/dotgo.go/@v1.0.0
# go get (without -d) should also succeed in either case.
-# TODO(golang.org/issue/32483): we should be consistent with 'go build',
-# 'go list', and other commands. 'go list example.com/dotgo.go' (above) and
-# 'go get example.com/dotgo.go' should both succeed or both fail.
[short] skip
go get example.com/dotgo.go
go get example.com/dotgo.go/
diff --git a/src/cmd/go/testdata/script/mod_getmode_vendor.txt b/src/cmd/go/testdata/script/mod_getmode_vendor.txt
index 7e1f6aa323..c532cee9cb 100644
--- a/src/cmd/go/testdata/script/mod_getmode_vendor.txt
+++ b/src/cmd/go/testdata/script/mod_getmode_vendor.txt
@@ -13,7 +13,7 @@ stdout '^golang.org/x/text v0.0.0.* .*vendor[\\/]golang.org[\\/]x[\\/]text$'
! go list -mod=vendor -m rsc.io/quote@latest
stderr 'module lookup disabled by -mod=vendor'
! go get -mod=vendor -u
-stderr 'go get: disabled by -mod=vendor'
+stderr 'flag provided but not defined: -mod'
-- go.mod --
module x
diff --git a/src/cmd/go/testdata/script/mod_list_upgrade.txt b/src/cmd/go/testdata/script/mod_list_upgrade.txt
index f2d0649092..474df0dc26 100644
--- a/src/cmd/go/testdata/script/mod_list_upgrade.txt
+++ b/src/cmd/go/testdata/script/mod_list_upgrade.txt
@@ -1,28 +1,8 @@
env GO111MODULE=on
-# If the current version is not latest, 'go list -u' should include its upgrade.
go list -m -u all
stdout 'rsc.io/quote v1.2.0 \[v1\.5\.2\]'
-# If the current version is latest, 'go list -u' should omit the upgrade.
-go get -d rsc.io/quote@v1.5.2
-go list -m -u all
-stdout 'rsc.io/quote v1.5.2$'
-
-# If the current version is newer than latest, 'go list -u' should
-# omit the upgrade.
-go get -d rsc.io/quote@v1.5.3-pre1
-go list -m -u all
-stdout 'rsc.io/quote v1.5.3-pre1$'
-
-# If the current build list has a higher version and the user asks about
-# a lower one, -u should report the upgrade for the lower one
-# but leave the build list unchanged.
-go list -m -u rsc.io/quote@v1.5.1
-stdout 'rsc.io/quote v1.5.1 \[v1.5.2\]$'
-go list -m -u rsc.io/quote
-stdout 'rsc.io/quote v1.5.3-pre1$'
-
-- go.mod --
module x
require rsc.io/quote v1.2.0
diff --git a/src/cmd/internal/obj/arm64/a.out.go b/src/cmd/internal/obj/arm64/a.out.go
index f793cdc4f9..4e5eb75a22 100644
--- a/src/cmd/internal/obj/arm64/a.out.go
+++ b/src/cmd/internal/obj/arm64/a.out.go
@@ -956,6 +956,10 @@ const (
AVLD2
AVLD3
AVLD4
+ AVLD1R
+ AVLD2R
+ AVLD3R
+ AVLD4R
AVORR
AVREV32
AVREV64
diff --git a/src/cmd/internal/obj/arm64/anames.go b/src/cmd/internal/obj/arm64/anames.go
index 621af6c195..2c277dfb95 100644
--- a/src/cmd/internal/obj/arm64/anames.go
+++ b/src/cmd/internal/obj/arm64/anames.go
@@ -463,6 +463,10 @@ var Anames = []string{
"VLD2",
"VLD3",
"VLD4",
+ "VLD1R",
+ "VLD2R",
+ "VLD3R",
+ "VLD4R",
"VORR",
"VREV32",
"VREV64",
diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
index 47586ba262..c7fa943e7e 100644
--- a/src/cmd/internal/obj/arm64/asm7.go
+++ b/src/cmd/internal/obj/arm64/asm7.go
@@ -784,15 +784,9 @@ var optab = []Optab{
{AVLD1, C_ZOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, 0},
{AVLD1, C_LOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
{AVLD1, C_ROFF, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
- {AVLD2, C_ZOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, 0},
- {AVLD2, C_LOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
- {AVLD2, C_ROFF, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
- {AVLD3, C_ZOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, 0},
- {AVLD3, C_LOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
- {AVLD3, C_ROFF, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
- {AVLD4, C_ZOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, 0},
- {AVLD4, C_LOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
- {AVLD4, C_ROFF, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
+ {AVLD1R, C_ZOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, 0},
+ {AVLD1R, C_LOREG, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
+ {AVLD1R, C_ROFF, C_NONE, C_NONE, C_LIST, 81, 4, 0, 0, C_XPOST},
{AVLD1, C_LOREG, C_NONE, C_NONE, C_ELEM, 97, 4, 0, 0, C_XPOST},
{AVLD1, C_ROFF, C_NONE, C_NONE, C_ELEM, 97, 4, 0, 0, C_XPOST},
{AVLD1, C_LOREG, C_NONE, C_NONE, C_ELEM, 97, 4, 0, 0, 0},
@@ -2709,13 +2703,18 @@ func buildop(ctxt *obj.Link) {
case AVZIP1:
oprangeset(AVZIP2, t)
+ case AVLD1R:
+ oprangeset(AVLD2, t)
+ oprangeset(AVLD2R, t)
+ oprangeset(AVLD3, t)
+ oprangeset(AVLD3R, t)
+ oprangeset(AVLD4, t)
+ oprangeset(AVLD4R, t)
+
case ASHA1H,
AVCNT,
AVMOV,
AVLD1,
- AVLD2,
- AVLD3,
- AVLD4,
AVST1,
AVST2,
AVST3,
@@ -2803,7 +2802,7 @@ func (c *ctxt7) checkindex(p *obj.Prog, index, maxindex int) {
func (c *ctxt7) checkoffset(p *obj.Prog, as obj.As) {
var offset, list, n, expect int64
switch as {
- case AVLD1, AVLD2, AVLD3, AVLD4:
+ case AVLD1, AVLD2, AVLD3, AVLD4, AVLD1R, AVLD2R, AVLD3R, AVLD4R:
offset = p.From.Offset
list = p.To.Offset
case AVST1, AVST2, AVST3, AVST4:
@@ -2836,11 +2835,13 @@ func (c *ctxt7) checkoffset(p *obj.Prog, as obj.As) {
switch as {
case AVLD1, AVST1:
return
- case AVLD2, AVST2:
+ case AVLD1R:
+ expect = 1
+ case AVLD2, AVST2, AVLD2R:
expect = 2
- case AVLD3, AVST3:
+ case AVLD3, AVST3, AVLD3R:
expect = 3
- case AVLD4, AVST4:
+ case AVLD4, AVST4, AVLD4R:
expect = 4
}
@@ -4344,10 +4345,10 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
}
o1 |= (uint32(imm5&0x1f) << 16) | (uint32(rf&31) << 5) | uint32(rt&31)
- case 81: /* vld[1-4] (Rn), [Vt1.<T>, Vt2.<T>, ...] */
+ case 81: /* vld[1-4]|vld[1-4]r (Rn), [Vt1.<T>, Vt2.<T>, ...] */
c.checkoffset(p, p.As)
r := int(p.From.Reg)
- o1 = 3<<26 | 1<<22
+ o1 = c.oprrr(p, p.As)
if o.scond == C_XPOST {
o1 |= 1 << 23
if p.From.Index == 0 {
@@ -4358,7 +4359,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
if isRegShiftOrExt(&p.From) {
c.ctxt.Diag("invalid extended register op: %v\n", p)
}
- o1 |= uint32(p.From.Index&31) << 16
+ o1 |= uint32(p.From.Index&0x1f) << 16
}
}
o1 |= uint32(p.To.Offset)
@@ -5591,6 +5592,15 @@ func (c *ctxt7) oprrr(p *obj.Prog, a obj.As) uint32 {
case AVRBIT:
return 0x2E<<24 | 1<<22 | 0x10<<17 | 5<<12 | 2<<10
+
+ case AVLD1, AVLD2, AVLD3, AVLD4:
+ return 3<<26 | 1<<22
+
+ case AVLD1R, AVLD3R:
+ return 0xD<<24 | 1<<22
+
+ case AVLD2R, AVLD4R:
+ return 0xD<<24 | 3<<21
}
c.ctxt.Diag("%v: bad rrr %d %v", p, a, a)
@@ -6779,6 +6789,10 @@ func (c *ctxt7) maskOpvldvst(p *obj.Prog, o1 uint32) uint32 {
o1 &^= 0xf000 // mask out "opcode" field (bit 12-15)
switch p.As {
+ case AVLD1R, AVLD2R:
+ o1 |= 0xC << 12
+ case AVLD3R, AVLD4R:
+ o1 |= 0xE << 12
case AVLD2, AVST2:
o1 |= 8 << 12
case AVLD3, AVST3:
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go
index 30a8414d4a..916116d1a3 100644
--- a/src/cmd/internal/obj/ppc64/obj9.go
+++ b/src/cmd/internal/obj/ppc64/obj9.go
@@ -106,10 +106,10 @@ func progedit(ctxt *obj.Link, p *obj.Prog, newprog obj.ProgAlloc) {
p.As = AADD
}
}
- if c.ctxt.Flag_dynlink {
- c.rewriteToUseGot(p)
- } else if c.ctxt.Headtype == objabi.Haix {
+ if c.ctxt.Headtype == objabi.Haix {
c.rewriteToUseTOC(p)
+ } else if c.ctxt.Flag_dynlink {
+ c.rewriteToUseGot(p)
}
}
@@ -120,6 +120,62 @@ func (c *ctxt9) rewriteToUseTOC(p *obj.Prog) {
return
}
+ if p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO {
+ // ADUFFZERO/ADUFFCOPY is considered as an ABL except in dynamic
+ // link where it should be an indirect call.
+ if !c.ctxt.Flag_dynlink {
+ return
+ }
+ // ADUFFxxx $offset
+ // becomes
+ // MOVD runtime.duffxxx@TOC, R12
+ // ADD $offset, R12
+ // MOVD R12, CTR
+ // BL (CTR)
+ var sym *obj.LSym
+ if p.As == obj.ADUFFZERO {
+ sym = c.ctxt.Lookup("runtime.duffzero")
+ } else {
+ sym = c.ctxt.Lookup("runtime.duffcopy")
+ }
+ // Retrieve or create the TOC anchor.
+ symtoc := c.ctxt.LookupInit("TOC."+sym.Name, func(s *obj.LSym) {
+ s.Type = objabi.SDATA
+ s.Set(obj.AttrDuplicateOK, true)
+ c.ctxt.Data = append(c.ctxt.Data, s)
+ s.WriteAddr(c.ctxt, 0, 8, sym, 0)
+ })
+
+ offset := p.To.Offset
+ p.As = AMOVD
+ p.From.Type = obj.TYPE_MEM
+ p.From.Name = obj.NAME_TOCREF
+ p.From.Sym = symtoc
+ p.To.Type = obj.TYPE_REG
+ p.To.Reg = REG_R12
+ p.To.Name = obj.NAME_NONE
+ p.To.Offset = 0
+ p.To.Sym = nil
+ p1 := obj.Appendp(p, c.newprog)
+ p1.As = AADD
+ p1.From.Type = obj.TYPE_CONST
+ p1.From.Offset = offset
+ p1.To.Type = obj.TYPE_REG
+ p1.To.Reg = REG_R12
+ p2 := obj.Appendp(p1, c.newprog)
+ p2.As = AMOVD
+ p2.From.Type = obj.TYPE_REG
+ p2.From.Reg = REG_R12
+ p2.To.Type = obj.TYPE_REG
+ p2.To.Reg = REG_CTR
+ p3 := obj.Appendp(p2, c.newprog)
+ p3.As = obj.ACALL
+ p3.From.Type = obj.TYPE_REG
+ p3.From.Reg = REG_R12
+ p3.To.Type = obj.TYPE_REG
+ p3.To.Reg = REG_CTR
+ }
+
var source *obj.Addr
if p.From.Name == obj.NAME_EXTERN || p.From.Name == obj.NAME_STATIC {
if p.From.Type == obj.TYPE_ADDR {
diff --git a/src/cmd/internal/src/pos.go b/src/cmd/internal/src/pos.go
index c9d3d347db..8c0b6d277b 100644
--- a/src/cmd/internal/src/pos.go
+++ b/src/cmd/internal/src/pos.go
@@ -381,8 +381,9 @@ func makeLico(line, col uint) lico {
return makeLicoRaw(line, col)
}
-func (x lico) Line() uint { return uint(x) >> lineShift }
-func (x lico) Col() uint { return uint(x) >> colShift & colMax }
+func (x lico) Line() uint { return uint(x) >> lineShift }
+func (x lico) SameLine(y lico) bool { return 0 == (x^y)&^lico(1 << lineShift-1) }
+func (x lico) Col() uint { return uint(x) >> colShift & colMax }
func (x lico) IsStmt() uint {
if x == 0 {
return PosNotStmt
diff --git a/src/cmd/internal/src/xpos.go b/src/cmd/internal/src/xpos.go
index da90ccdb78..54fe64cf86 100644
--- a/src/cmd/internal/src/xpos.go
+++ b/src/cmd/internal/src/xpos.go
@@ -35,6 +35,11 @@ func (p XPos) SameFile(q XPos) bool {
return p.index == q.index
}
+// SameFileAndLine reports whether p and q are positions on the same line in the same file.
+func (p XPos) SameFileAndLine(q XPos) bool {
+ return p.index == q.index && p.lico.SameLine(q.lico)
+}
+
// After reports whether the position p comes after q in the source.
// For positions with different bases, ordering is by base index.
func (p XPos) After(q XPos) bool {
diff --git a/src/cmd/link/internal/ld/outbuf_nommap.go b/src/cmd/link/internal/ld/outbuf_nommap.go
index 36a3286099..fba8cd8bc4 100644
--- a/src/cmd/link/internal/ld/outbuf_nommap.go
+++ b/src/cmd/link/internal/ld/outbuf_nommap.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !darwin,!dragonfly,!freebsd,!linux,!openbsd
+// +build !darwin,!dragonfly,!freebsd,!linux,!openbsd,!windows
package ld
diff --git a/src/cmd/link/internal/ld/outbuf_windows.go b/src/cmd/link/internal/ld/outbuf_windows.go
new file mode 100644
index 0000000000..1cb05c301f
--- /dev/null
+++ b/src/cmd/link/internal/ld/outbuf_windows.go
@@ -0,0 +1,49 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ld
+
+import (
+ "reflect"
+ "syscall"
+ "unsafe"
+)
+
+func (out *OutBuf) Mmap(filesize uint64) error {
+ err := out.f.Truncate(int64(filesize))
+ if err != nil {
+ Exitf("resize output file failed: %v", err)
+ }
+
+ low, high := uint32(filesize), uint32(filesize>>32)
+ fmap, err := syscall.CreateFileMapping(syscall.Handle(out.f.Fd()), nil, syscall.PAGE_READONLY, high, low, nil)
+ if err != nil {
+ return err
+ }
+ defer syscall.CloseHandle(fmap)
+
+ ptr, err := syscall.MapViewOfFile(fmap, syscall.FILE_MAP_READ|syscall.FILE_MAP_WRITE, 0, 0, uintptr(filesize))
+ if err != nil {
+ return err
+ }
+ *(*reflect.SliceHeader)(unsafe.Pointer(&out.buf)) = reflect.SliceHeader{Data: ptr, Len: int(filesize), Cap: int(filesize)}
+ return nil
+}
+
+func (out *OutBuf) Munmap() {
+ if out.buf == nil {
+ return
+ }
+ err := syscall.UnmapViewOfFile(uintptr(unsafe.Pointer(&out.buf[0])))
+ if err != nil {
+ Exitf("UnmapViewOfFile failed: %v", err)
+ }
+}
+
+func (out *OutBuf) Msync() error {
+ if out.buf == nil {
+ return nil
+ }
+ return syscall.FlushViewOfFile(uintptr(unsafe.Pointer(&out.buf[0])), 0)
+}
diff --git a/src/cmd/link/internal/wasm/asm.go b/src/cmd/link/internal/wasm/asm.go
index 54b265cb19..ee0a5176ac 100644
--- a/src/cmd/link/internal/wasm/asm.go
+++ b/src/cmd/link/internal/wasm/asm.go
@@ -11,7 +11,6 @@ import (
"cmd/link/internal/sym"
"io"
"regexp"
- "runtime"
)
const (
@@ -177,7 +176,6 @@ func asmb2(ctxt *ld.Link) {
writeBuildID(ctxt, buildid)
}
- writeGoVersion(ctxt)
writeTypeSec(ctxt, types)
writeImportSec(ctxt, hostImports)
writeFunctionSec(ctxt, fns)
@@ -188,6 +186,7 @@ func asmb2(ctxt *ld.Link) {
writeElementSec(ctxt, uint64(len(hostImports)), uint64(len(fns)))
writeCodeSec(ctxt, fns)
writeDataSec(ctxt)
+ writeProducerSec(ctxt)
if !*ld.FlagS {
writeNameSec(ctxt, len(hostImports), fns)
}
@@ -226,13 +225,6 @@ func writeBuildID(ctxt *ld.Link, buildid []byte) {
writeSecSize(ctxt, sizeOffset)
}
-func writeGoVersion(ctxt *ld.Link) {
- sizeOffset := writeSecHeader(ctxt, sectionCustom)
- writeName(ctxt.Out, "go.version")
- ctxt.Out.Write([]byte(runtime.Version()))
- writeSecSize(ctxt, sizeOffset)
-}
-
// writeTypeSec writes the section that declares all function types
// so they can be referenced by index.
func writeTypeSec(ctxt *ld.Link, types []*wasmFuncType) {
@@ -488,6 +480,26 @@ func writeDataSec(ctxt *ld.Link) {
writeSecSize(ctxt, sizeOffset)
}
+// writeProducerSec writes an optional section that reports the source language and compiler version.
+func writeProducerSec(ctxt *ld.Link) {
+ sizeOffset := writeSecHeader(ctxt, sectionCustom)
+ writeName(ctxt.Out, "producers")
+
+ writeUleb128(ctxt.Out, 2) // number of fields
+
+ writeName(ctxt.Out, "language") // field name
+ writeUleb128(ctxt.Out, 1) // number of values
+ writeName(ctxt.Out, "Go") // value: name
+ writeName(ctxt.Out, objabi.Version) // value: version
+
+ writeName(ctxt.Out, "processed-by") // field name
+ writeUleb128(ctxt.Out, 1) // number of values
+ writeName(ctxt.Out, "Go cmd/compile") // value: name
+ writeName(ctxt.Out, objabi.Version) // value: version
+
+ writeSecSize(ctxt, sizeOffset)
+}
+
var nameRegexp = regexp.MustCompile(`[^\w\.]`)
// writeNameSec writes an optional section that assigns names to the functions declared by the "func" section.
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go
index 19e1e421a3..bc58c31c9f 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go
@@ -128,11 +128,13 @@ type Pass struct {
// See comments for ExportObjectFact.
ExportPackageFact func(fact Fact)
- // AllPackageFacts returns a new slice containing all package facts in unspecified order.
+ // AllPackageFacts returns a new slice containing all package facts of the analysis's FactTypes
+ // in unspecified order.
// WARNING: This is an experimental API and may change in the future.
AllPackageFacts func() []PackageFact
- // AllObjectFacts returns a new slice containing all object facts in unspecified order.
+ // AllObjectFacts returns a new slice containing all object facts of the analysis's FactTypes
+ // in unspecified order.
// WARNING: This is an experimental API and may change in the future.
AllObjectFacts func() []ObjectFact
@@ -211,18 +213,3 @@ func (pass *Pass) String() string {
type Fact interface {
AFact() // dummy method to avoid type errors
}
-
-// A Diagnostic is a message associated with a source location or range.
-//
-// An Analyzer may return a variety of diagnostics; the optional Category,
-// which should be a constant, may be used to classify them.
-// It is primarily intended to make it easy to look up documentation.
-//
-// If End is provided, the diagnostic is specified to apply to the range between
-// Pos and End.
-type Diagnostic struct {
- Pos token.Pos
- End token.Pos // optional
- Category string // optional
- Message string
-}
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/diagnostic.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/diagnostic.go
new file mode 100644
index 0000000000..744072cd79
--- /dev/null
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/diagnostic.go
@@ -0,0 +1,48 @@
+package analysis
+
+import "go/token"
+
+// A Diagnostic is a message associated with a source location or range.
+//
+// An Analyzer may return a variety of diagnostics; the optional Category,
+// which should be a constant, may be used to classify them.
+// It is primarily intended to make it easy to look up documentation.
+//
+// If End is provided, the diagnostic is specified to apply to the range between
+// Pos and End.
+type Diagnostic struct {
+ Pos token.Pos
+ End token.Pos // optional
+ Category string // optional
+ Message string
+
+ // SuggestedFixes contains suggested fixes for a diagnostic which can be used to perform
+ // edits to a file that address the diagnostic.
+ // TODO(matloob): Should multiple SuggestedFixes be allowed for a diagnostic?
+ // Diagnostics should not contain SuggestedFixes that overlap.
+ // Experimental: This API is experimental and may change in the future.
+ SuggestedFixes []SuggestedFix // optional
+}
+
+// A SuggestedFix is a code change associated with a Diagnostic that a user can choose
+// to apply to their code. Usually the SuggestedFix is meant to fix the issue flagged
+// by the diagnostic.
+// TextEdits for a SuggestedFix should not overlap. TextEdits for a SuggestedFix
+// should not contain edits for other packages.
+// Experimental: This API is experimental and may change in the future.
+type SuggestedFix struct {
+ // A description for this suggested fix to be shown to a user deciding
+ // whether to accept it.
+ Message string
+ TextEdits []TextEdit
+}
+
+// A TextEdit represents the replacement of the code between Pos and End with the new text.
+// Each TextEdit should apply to a single file. End should not be earlier in the file than Pos.
+// Experimental: This API is experimental and may change in the future.
+type TextEdit struct {
+ // For a pure insertion, End can either be set to Pos or token.NoPos.
+ Pos token.Pos
+ End token.Pos
+ NewText []byte
+}
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go
index 2d44b0458a..a2353fc88b 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go
@@ -67,7 +67,7 @@ To add a new Analyzer to an existing driver, add another item to the list:
}
A driver may use the name, flags, and documentation to provide on-line
-help that describes the analyses its performs.
+help that describes the analyses it performs.
The doc comment contains a brief one-line summary,
optionally followed by paragraphs of explanation.
The vet command, shown below, is an example of a driver that runs
@@ -169,7 +169,7 @@ type information, and source positions for a single package of Go code.
The OtherFiles field provides the names, but not the contents, of non-Go
files such as assembly that are part of this package. See the "asmdecl"
-or "buildtags" analyzers for examples of loading non-Go files and report
+or "buildtags" analyzers for examples of loading non-Go files and reporting
diagnostics against them.
The ResultOf field provides the results computed by the analyzers
@@ -231,7 +231,7 @@ understood as alternative or non-standard type systems. For example,
vet's printf checker infers whether a function has the "printf wrapper"
type, and it applies stricter checks to calls of such functions. In
addition, it records which functions are printf wrappers for use by
-later analysis units to identify other printf wrappers by induction.
+later analysis passes to identify other printf wrappers by induction.
A result such as “f is a printf wrapper” that is not interesting by
itself but serves as a stepping stone to an interesting result (such as
a diagnostic) is called a "fact".
@@ -252,9 +252,9 @@ An Analyzer that uses facts must declare their types:
type isWrapper struct{} // => *types.Func f “is a printf wrapper”
-A driver program ensures that facts for a pass’s dependencies are
-generated before analyzing the pass and are responsible for propagating
-facts between from one pass to another, possibly across address spaces.
+The driver program ensures that facts for a pass’s dependencies are
+generated before analyzing the package and is responsible for propagating
+facts from one package to another, possibly across address spaces.
Consequently, Facts must be serializable. The API requires that drivers
use the gob encoding, an efficient, robust, self-describing binary
protocol. A fact type may implement the GobEncoder/GobDecoder interfaces
@@ -288,10 +288,10 @@ not currently apply analyzers to packages of the standard library.
Therefore, for best results, analyzer authors should not rely on
analysis facts being available for standard packages.
For example, although the printf checker is capable of deducing during
-analysis of the log package that log.Printf is a printf-wrapper,
+analysis of the log package that log.Printf is a printf wrapper,
this fact is built in to the analyzer so that it correctly checks
calls to log.Printf even when run in a driver that does not apply
-it to standard packages. We plan to remove this limitation in future.
+it to standard packages. We would like to remove this limitation in future.
Testing an Analyzer
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go
index a3c2f09630..0778f42207 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go
@@ -168,10 +168,10 @@ func printFlags() {
var flags []jsonFlag = nil
flag.VisitAll(func(f *flag.Flag) {
// Don't report {single,multi}checker debugging
- // flags as these have no effect on unitchecker
+ // flags or fix as these have no effect on unitchecker
// (as invoked by 'go vet').
switch f.Name {
- case "debug", "cpuprofile", "memprofile", "trace":
+ case "debug", "cpuprofile", "memprofile", "trace", "fix":
return
}
@@ -209,7 +209,7 @@ func (versionFlag) Set(s string) error {
log.Fatalf("unsupported flag value: -V=%s", s)
}
- // This replicates the miminal subset of
+ // This replicates the minimal subset of
// cmd/internal/objabi.AddVersionFlag, which is private to the
// go tool yet forms part of our command-line interface.
// TODO(adonovan): clarify the contract.
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/facts/facts.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/facts/facts.go
index 468f148900..07984521c3 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/facts/facts.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/facts/facts.go
@@ -29,7 +29,7 @@
// The notion of "exportedness" that matters here is that of the
// compiler. According to the language spec, a method pkg.T.f is
// unexported simply because its name starts with lowercase. But the
-// compiler must nonethless export f so that downstream compilations can
+// compiler must nonetheless export f so that downstream compilations can
// accurately ascertain whether pkg.T implements an interface pkg.I
// defined as interface{f()}. Exported thus means "described in export
// data".
@@ -99,6 +99,16 @@ func (s *Set) ExportObjectFact(obj types.Object, fact analysis.Fact) {
s.mu.Unlock()
}
+func (s *Set) AllObjectFacts(filter map[reflect.Type]bool) []analysis.ObjectFact {
+ var facts []analysis.ObjectFact
+ for k, v := range s.m {
+ if k.obj != nil && filter[k.t] {
+ facts = append(facts, analysis.ObjectFact{Object: k.obj, Fact: v})
+ }
+ }
+ return facts
+}
+
// ImportPackageFact implements analysis.Pass.ImportPackageFact.
func (s *Set) ImportPackageFact(pkg *types.Package, ptr analysis.Fact) bool {
if pkg == nil {
@@ -122,6 +132,16 @@ func (s *Set) ExportPackageFact(fact analysis.Fact) {
s.mu.Unlock()
}
+func (s *Set) AllPackageFacts(filter map[reflect.Type]bool) []analysis.PackageFact {
+ var facts []analysis.PackageFact
+ for k, v := range s.m {
+ if k.obj == nil && filter[k.t] {
+ facts = append(facts, analysis.PackageFact{Package: k.pkg, Fact: v})
+ }
+ }
+ return facts
+}
+
// gobFact is the Gob declaration of a serialized fact.
type gobFact struct {
PkgPath string // path of package
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go
index 4dff2908c3..3586638efc 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go
@@ -9,6 +9,7 @@ package assign
// methods that are on T instead of *T.
import (
+ "fmt"
"go/ast"
"go/token"
"reflect"
@@ -59,7 +60,14 @@ func run(pass *analysis.Pass) (interface{}, error) {
le := analysisutil.Format(pass.Fset, lhs)
re := analysisutil.Format(pass.Fset, rhs)
if le == re {
- pass.Reportf(stmt.Pos(), "self-assignment of %s to %s", re, le)
+ pass.Report(analysis.Diagnostic{
+ Pos: stmt.Pos(), Message: fmt.Sprintf("self-assignment of %s to %s", re, le),
+ SuggestedFixes: []analysis.SuggestedFix{
+ {Message: "Remove", TextEdits: []analysis.TextEdit{
+ {Pos: stmt.Pos(), End: stmt.End(), NewText: []byte{}},
+ }},
+ },
+ })
}
}
})
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
index 1e4fac8595..d499f3c329 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
@@ -107,7 +107,7 @@ func checkCgo(fset *token.FileSet, f *ast.File, info *types.Info, reportf func(t
// cgo files of a package (those that import "C"). Such files are not
// Go, so there may be gaps in type information around C.f references.
//
-// This checker was initially written in vet to inpect raw cgo source
+// This checker was initially written in vet to inspect raw cgo source
// files using partial type information. However, Analyzers in the new
// analysis API are presented with the type-checked, "cooked" Go ASTs
// resulting from cgo-processing files, so we must choose between
@@ -133,7 +133,7 @@ func checkCgo(fset *token.FileSet, f *ast.File, info *types.Info, reportf func(t
// func (T) f(int) string { ... }
//
// we synthesize a new ast.File, shown below, that dot-imports the
-// orginal "cooked" package using a special name ("·this·"), so that all
+// original "cooked" package using a special name ("·this·"), so that all
// references to package members resolve correctly. (References to
// unexported names cause an "unexported" error, which we ignore.)
//
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/whitelist.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/whitelist.go
index ab609f279b..1e5f5fd20b 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/whitelist.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/whitelist.go
@@ -24,6 +24,7 @@ var unkeyedLiteral = map[string]bool{
"image.Uniform": true,
"unicode.Range16": true,
+ "unicode.Range32": true,
// These three structs are used in generated test main files,
// but the generator can be trusted.
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ctrlflow/ctrlflow.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ctrlflow/ctrlflow.go
index 75655c5bad..51600ffc7e 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ctrlflow/ctrlflow.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/ctrlflow/ctrlflow.go
@@ -102,10 +102,11 @@ func run(pass *analysis.Pass) (interface{}, error) {
inspect.Preorder(nodeFilter, func(n ast.Node) {
switch n := n.(type) {
case *ast.FuncDecl:
- fn := pass.TypesInfo.Defs[n.Name].(*types.Func)
- funcDecls[fn] = &declInfo{decl: n}
- decls = append(decls, fn)
-
+ // Type information may be incomplete.
+ if fn, ok := pass.TypesInfo.Defs[n.Name].(*types.Func); ok {
+ funcDecls[fn] = &declInfo{decl: n}
+ decls = append(decls, fn)
+ }
case *ast.FuncLit:
funcLits[n] = new(litInfo)
lits = append(lits, n)
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/errorsas/errorsas.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/errorsas/errorsas.go
index c411466c28..01abc70017 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/errorsas/errorsas.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/errorsas/errorsas.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// The errorsas package defines an Analyzer that checks that the second arugment to
+// The errorsas package defines an Analyzer that checks that the second argument to
// errors.As is a pointer to a type implementing error.
package errorsas
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go
index f59e95dc21..f0d7e44c65 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go
@@ -67,15 +67,20 @@ of arguments with no format string.
`
// isWrapper is a fact indicating that a function is a print or printf wrapper.
-type isWrapper struct{ Printf bool }
+type isWrapper struct{ Kind funcKind }
func (f *isWrapper) AFact() {}
func (f *isWrapper) String() string {
- if f.Printf {
+ switch f.Kind {
+ case kindPrintf:
return "printfWrapper"
- } else {
+ case kindPrint:
return "printWrapper"
+ case kindErrorf:
+ return "errorfWrapper"
+ default:
+ return "unknownWrapper"
}
}
@@ -112,7 +117,11 @@ func maybePrintfWrapper(info *types.Info, decl ast.Decl) *printfWrapper {
if !ok || fdecl.Body == nil {
return nil
}
- fn := info.Defs[fdecl.Name].(*types.Func)
+ fn, ok := info.Defs[fdecl.Name].(*types.Func)
+ // Type information may be incomplete.
+ if !ok {
+ return nil
+ }
sig := fn.Type().(*types.Signature)
if !sig.Variadic() {
@@ -223,16 +232,20 @@ func match(info *types.Info, arg ast.Expr, param *types.Var) bool {
return ok && info.ObjectOf(id) == param
}
+type funcKind int
+
const (
- kindPrintf = 1
- kindPrint = 2
+ kindUnknown funcKind = iota
+ kindPrintf = iota
+ kindPrint
+ kindErrorf
)
// checkPrintfFwd checks that a printf-forwarding wrapper is forwarding correctly.
// It diagnoses writing fmt.Printf(format, args) instead of fmt.Printf(format, args...).
-func checkPrintfFwd(pass *analysis.Pass, w *printfWrapper, call *ast.CallExpr, kind int) {
+func checkPrintfFwd(pass *analysis.Pass, w *printfWrapper, call *ast.CallExpr, kind funcKind) {
matched := kind == kindPrint ||
- kind == kindPrintf && len(call.Args) >= 2 && match(pass.TypesInfo, call.Args[len(call.Args)-2], w.format)
+ kind != kindUnknown && len(call.Args) >= 2 && match(pass.TypesInfo, call.Args[len(call.Args)-2], w.format)
if !matched {
return
}
@@ -262,7 +275,7 @@ func checkPrintfFwd(pass *analysis.Pass, w *printfWrapper, call *ast.CallExpr, k
fn := w.obj
var fact isWrapper
if !pass.ImportObjectFact(fn, &fact) {
- fact.Printf = kind == kindPrintf
+ fact.Kind = kind
pass.ExportObjectFact(fn, &fact)
for _, caller := range w.callers {
checkPrintfFwd(pass, caller.w, caller.call, kind)
@@ -414,42 +427,42 @@ func checkCall(pass *analysis.Pass) {
call := n.(*ast.CallExpr)
fn, kind := printfNameAndKind(pass, call)
switch kind {
- case kindPrintf:
- checkPrintf(pass, call, fn)
+ case kindPrintf, kindErrorf:
+ checkPrintf(pass, kind, call, fn)
case kindPrint:
checkPrint(pass, call, fn)
}
})
}
-func printfNameAndKind(pass *analysis.Pass, call *ast.CallExpr) (fn *types.Func, kind int) {
+func printfNameAndKind(pass *analysis.Pass, call *ast.CallExpr) (fn *types.Func, kind funcKind) {
fn, _ = typeutil.Callee(pass.TypesInfo, call).(*types.Func)
if fn == nil {
return nil, 0
}
- var fact isWrapper
- if pass.ImportObjectFact(fn, &fact) {
- if fact.Printf {
- return fn, kindPrintf
- } else {
- return fn, kindPrint
- }
- }
-
_, ok := isPrint[fn.FullName()]
if !ok {
// Next look up just "printf", for use with -printf.funcs.
_, ok = isPrint[strings.ToLower(fn.Name())]
}
if ok {
- if strings.HasSuffix(fn.Name(), "f") {
+ if fn.Name() == "Errorf" {
+ kind = kindErrorf
+ } else if strings.HasSuffix(fn.Name(), "f") {
kind = kindPrintf
} else {
kind = kindPrint
}
+ return fn, kind
+ }
+
+ var fact isWrapper
+ if pass.ImportObjectFact(fn, &fact) {
+ return fn, fact.Kind
}
- return fn, kind
+
+ return fn, kindUnknown
}
// isFormatter reports whether t satisfies fmt.Formatter.
@@ -491,7 +504,7 @@ type formatState struct {
}
// checkPrintf checks a call to a formatted print routine such as Printf.
-func checkPrintf(pass *analysis.Pass, call *ast.CallExpr, fn *types.Func) {
+func checkPrintf(pass *analysis.Pass, kind funcKind, call *ast.CallExpr, fn *types.Func) {
format, idx := formatString(pass, call)
if idx < 0 {
if false {
@@ -511,6 +524,7 @@ func checkPrintf(pass *analysis.Pass, call *ast.CallExpr, fn *types.Func) {
argNum := firstArg
maxArgNum := firstArg
anyIndex := false
+ anyW := false
for i, w := 0, 0; i < len(format); i += w {
w = 1
if format[i] != '%' {
@@ -527,6 +541,17 @@ func checkPrintf(pass *analysis.Pass, call *ast.CallExpr, fn *types.Func) {
if state.hasIndex {
anyIndex = true
}
+ if state.verb == 'w' {
+ if kind != kindErrorf {
+ pass.Reportf(call.Pos(), "%s call has error-wrapping directive %%w", state.name)
+ return
+ }
+ if anyW {
+ pass.Reportf(call.Pos(), "%s call has more than one error-wrapping directive %%w", state.name)
+ return
+ }
+ anyW = true
+ }
if len(state.argNums) > 0 {
// Continue with the next sequential argument.
argNum = state.argNums[len(state.argNums)-1] + 1
@@ -697,6 +722,7 @@ const (
argFloat
argComplex
argPointer
+ argError
anyType printfArgType = ^0
)
@@ -739,7 +765,7 @@ var printVerbs = []printVerb{
{'T', "-", anyType},
{'U', "-#", argRune | argInt},
{'v', allFlags, anyType},
- {'w', noFlag, anyType},
+ {'w', allFlags, argError},
{'x', sharpNumFlag, argRune | argInt | argString | argPointer},
{'X', sharpNumFlag, argRune | argInt | argString | argPointer},
}
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go
index 12286fd5df..bd8a594ef5 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go
@@ -37,6 +37,12 @@ func matchArgTypeInternal(pass *analysis.Pass, t printfArgType, typ types.Type,
return true // probably a type check problem
}
}
+
+ // %w accepts only errors.
+ if t == argError {
+ return types.ConvertibleTo(typ, errorType)
+ }
+
// If the type implements fmt.Formatter, we have nothing to check.
if isFormatter(typ) {
return true
@@ -228,7 +234,7 @@ func matchStructArgType(pass *analysis.Pass, t printfArgType, typ *types.Struct,
return false
}
if t&argString != 0 && !typf.Exported() && isConvertibleToString(pass, typf.Type()) {
- // Issue #17798: unexported Stringer or error cannot be properly fomatted.
+ // Issue #17798: unexported Stringer or error cannot be properly formatted.
return false
}
}
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go
index acc6e6c770..e09160379f 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go
@@ -40,7 +40,11 @@ func run(pass *analysis.Pass) (interface{}, error) {
(*ast.StructType)(nil),
}
inspect.Preorder(nodeFilter, func(n ast.Node) {
- styp := pass.TypesInfo.Types[n.(*ast.StructType)].Type.(*types.Struct)
+ styp, ok := pass.TypesInfo.Types[n.(*ast.StructType)].Type.(*types.Struct)
+ // Type information may be incomplete.
+ if !ok {
+ return
+ }
var seen namesSeen
for i := 0; i < styp.NumFields(); i++ {
field := styp.Field(i)
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go
index ba2e66fed2..2ed274949b 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go
@@ -42,6 +42,7 @@ import (
"log"
"os"
"path/filepath"
+ "reflect"
"sort"
"strings"
"sync"
@@ -322,6 +323,11 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re
return
}
+ factFilter := make(map[reflect.Type]bool)
+ for _, f := range a.FactTypes {
+ factFilter[reflect.TypeOf(f)] = true
+ }
+
pass := &analysis.Pass{
Analyzer: a,
Fset: fset,
@@ -334,8 +340,10 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re
Report: func(d analysis.Diagnostic) { act.diagnostics = append(act.diagnostics, d) },
ImportObjectFact: facts.ImportObjectFact,
ExportObjectFact: facts.ExportObjectFact,
+ AllObjectFacts: func() []analysis.ObjectFact { return facts.AllObjectFacts(factFilter) },
ImportPackageFact: facts.ImportPackageFact,
ExportPackageFact: facts.ExportPackageFact,
+ AllPackageFacts: func() []analysis.PackageFact { return facts.AllPackageFacts(factFilter) },
}
t0 := time.Now()
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go
index 6e6cf4984f..b984ab6c2d 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go
@@ -10,7 +10,7 @@ import (
// Checks include:
// that the name is a valid identifier;
// that analyzer names are unique;
-// that the Requires graph is acylic;
+// that the Requires graph is acyclic;
// that analyzer fact types are unique;
// that each fact type is a pointer.
func Validate(analyzers []*Analyzer) error {
diff --git a/src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go b/src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go
index 24e1aba033..7f95a2961a 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go
@@ -149,7 +149,7 @@ func (b *builder) branchStmt(s *ast.BranchStmt) {
}
case token.FALLTHROUGH:
- for t := b.targets; t != nil; t = t.tail {
+ for t := b.targets; t != nil && block == nil; t = t.tail {
block = t._fallthrough
}
diff --git a/src/cmd/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/src/cmd/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
index 0d85488efb..882e3b3d8a 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go
@@ -376,7 +376,7 @@ func Object(pkg *types.Package, p Path) (types.Object, error) {
return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj)
}
- // abtraction of *types.{Pointer,Slice,Array,Chan,Map}
+ // abstraction of *types.{Pointer,Slice,Array,Chan,Map}
type hasElem interface {
Elem() types.Type
}
diff --git a/src/cmd/vendor/modules.txt b/src/cmd/vendor/modules.txt
index e873ad4455..43f539fd81 100644
--- a/src/cmd/vendor/modules.txt
+++ b/src/cmd/vendor/modules.txt
@@ -26,7 +26,7 @@ golang.org/x/crypto/ssh/terminal
# golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82
golang.org/x/sys/unix
golang.org/x/sys/windows
-# golang.org/x/tools v0.0.0-20190611154301-25a4f137592f
+# golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b
golang.org/x/tools/go/analysis
golang.org/x/tools/go/analysis/internal/analysisflags
golang.org/x/tools/go/analysis/internal/facts