cmd/compile: try and access last argument first in rulegen

This reduces the number of extra bounds check hints we need to
insert. For example, rather than producing:

	_ = v.Args[2]
	x := v.Args[0]
	y := v.Args[1]
	z := v.Args[2]

We now produce:

	z := v.Args[2]
	x := v.Args[0]
	y := v.Args[1]

This gets rid of about 7000 lines of code from the rewrite rules.

Change-Id: I1291cf0f82e8d035a6d65bce7dee6cedee04cbcd
Reviewed-on: https://go-review.googlesource.com/c/go/+/167397
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Munday 2019-03-13 10:32:48 +00:00
parent 5d4fa147c7
commit 04f1b65cc6
13 changed files with 7349 additions and 14485 deletions

View File

@ -449,7 +449,6 @@ func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, t
}
if aux != "" {
if !isVariable(aux) {
// code
fmt.Fprintf(w, "if %s.Aux != %s {\nbreak\n}\n", v, aux)
@ -466,8 +465,18 @@ func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, t
}
}
// Access last argument first to minimize bounds checks.
if n := len(args); n > 1 {
fmt.Fprintf(w, "_ = %s.Args[%d]\n", v, n-1) // combine some bounds checks
a := args[n-1]
if _, set := m[a]; !set && a != "_" && isVariable(a) {
m[a] = struct{}{}
fmt.Fprintf(w, "%s := %s.Args[%d]\n", a, v, n-1)
// delete the last argument so it is not reprocessed
args = args[:n-1]
} else {
fmt.Fprintf(w, "_ = %s.Args[%d]\n", v, n-1)
}
}
for i, arg := range args {
if arg == "_" {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,6 @@ func rewriteValuedec_OpComplexImag_0(v *Value) bool {
if v_0.Op != OpComplexMake {
break
}
_ = v_0.Args[1]
imag := v_0.Args[1]
v.reset(OpCopy)
v.Type = imag.Type
@ -87,7 +86,6 @@ func rewriteValuedec_OpIData_0(v *Value) bool {
if v_0.Op != OpIMake {
break
}
_ = v_0.Args[1]
data := v_0.Args[1]
v.reset(OpCopy)
v.Type = data.Type
@ -123,9 +121,8 @@ func rewriteValuedec_OpLoad_0(v *Value) bool {
// result: (ComplexMake (Load <typ.Float32> ptr mem) (Load <typ.Float32> (OffPtr <typ.Float32Ptr> [4] ptr) mem) )
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(t.IsComplex() && t.Size() == 8) {
break
}
@ -148,9 +145,8 @@ func rewriteValuedec_OpLoad_0(v *Value) bool {
// result: (ComplexMake (Load <typ.Float64> ptr mem) (Load <typ.Float64> (OffPtr <typ.Float64Ptr> [8] ptr) mem) )
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(t.IsComplex() && t.Size() == 16) {
break
}
@ -173,9 +169,8 @@ func rewriteValuedec_OpLoad_0(v *Value) bool {
// result: (StringMake (Load <typ.BytePtr> ptr mem) (Load <typ.Int> (OffPtr <typ.IntPtr> [config.PtrSize] ptr) mem))
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(t.IsString()) {
break
}
@ -198,9 +193,8 @@ func rewriteValuedec_OpLoad_0(v *Value) bool {
// result: (SliceMake (Load <t.Elem().PtrTo()> ptr mem) (Load <typ.Int> (OffPtr <typ.IntPtr> [config.PtrSize] ptr) mem) (Load <typ.Int> (OffPtr <typ.IntPtr> [2*config.PtrSize] ptr) mem))
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(t.IsSlice()) {
break
}
@ -230,9 +224,8 @@ func rewriteValuedec_OpLoad_0(v *Value) bool {
// result: (IMake (Load <typ.Uintptr> ptr mem) (Load <typ.BytePtr> (OffPtr <typ.BytePtrPtr> [config.PtrSize] ptr) mem))
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(t.IsInterface()) {
break
}
@ -261,7 +254,6 @@ func rewriteValuedec_OpSliceCap_0(v *Value) bool {
if v_0.Op != OpSliceMake {
break
}
_ = v_0.Args[2]
cap := v_0.Args[2]
v.reset(OpCopy)
v.Type = cap.Type
@ -315,16 +307,14 @@ func rewriteValuedec_OpStore_0(v *Value) bool {
// result: (Store {typ.Float32} (OffPtr <typ.Float32Ptr> [4] dst) imag (Store {typ.Float32} dst real mem))
for {
t := v.Aux
_ = v.Args[2]
mem := v.Args[2]
dst := v.Args[0]
v_1 := v.Args[1]
if v_1.Op != OpComplexMake {
break
}
_ = v_1.Args[1]
real := v_1.Args[0]
imag := v_1.Args[1]
mem := v.Args[2]
real := v_1.Args[0]
if !(t.(*types.Type).Size() == 8) {
break
}
@ -348,16 +338,14 @@ func rewriteValuedec_OpStore_0(v *Value) bool {
// result: (Store {typ.Float64} (OffPtr <typ.Float64Ptr> [8] dst) imag (Store {typ.Float64} dst real mem))
for {
t := v.Aux
_ = v.Args[2]
mem := v.Args[2]
dst := v.Args[0]
v_1 := v.Args[1]
if v_1.Op != OpComplexMake {
break
}
_ = v_1.Args[1]
real := v_1.Args[0]
imag := v_1.Args[1]
mem := v.Args[2]
real := v_1.Args[0]
if !(t.(*types.Type).Size() == 16) {
break
}
@ -380,16 +368,14 @@ func rewriteValuedec_OpStore_0(v *Value) bool {
// cond:
// result: (Store {typ.Int} (OffPtr <typ.IntPtr> [config.PtrSize] dst) len (Store {typ.BytePtr} dst ptr mem))
for {
_ = v.Args[2]
mem := v.Args[2]
dst := v.Args[0]
v_1 := v.Args[1]
if v_1.Op != OpStringMake {
break
}
_ = v_1.Args[1]
ptr := v_1.Args[0]
len := v_1.Args[1]
mem := v.Args[2]
ptr := v_1.Args[0]
v.reset(OpStore)
v.Aux = typ.Int
v0 := b.NewValue0(v.Pos, OpOffPtr, typ.IntPtr)
@ -409,17 +395,15 @@ func rewriteValuedec_OpStore_0(v *Value) bool {
// cond:
// result: (Store {typ.Int} (OffPtr <typ.IntPtr> [2*config.PtrSize] dst) cap (Store {typ.Int} (OffPtr <typ.IntPtr> [config.PtrSize] dst) len (Store {typ.BytePtr} dst ptr mem)))
for {
_ = v.Args[2]
mem := v.Args[2]
dst := v.Args[0]
v_1 := v.Args[1]
if v_1.Op != OpSliceMake {
break
}
_ = v_1.Args[2]
cap := v_1.Args[2]
ptr := v_1.Args[0]
len := v_1.Args[1]
cap := v_1.Args[2]
mem := v.Args[2]
v.reset(OpStore)
v.Aux = typ.Int
v0 := b.NewValue0(v.Pos, OpOffPtr, typ.IntPtr)
@ -447,16 +431,14 @@ func rewriteValuedec_OpStore_0(v *Value) bool {
// cond:
// result: (Store {typ.BytePtr} (OffPtr <typ.BytePtrPtr> [config.PtrSize] dst) data (Store {typ.Uintptr} dst itab mem))
for {
_ = v.Args[2]
mem := v.Args[2]
dst := v.Args[0]
v_1 := v.Args[1]
if v_1.Op != OpIMake {
break
}
_ = v_1.Args[1]
itab := v_1.Args[0]
data := v_1.Args[1]
mem := v.Args[2]
itab := v_1.Args[0]
v.reset(OpStore)
v.Aux = typ.BytePtr
v0 := b.NewValue0(v.Pos, OpOffPtr, typ.BytePtrPtr)
@ -483,7 +465,6 @@ func rewriteValuedec_OpStringLen_0(v *Value) bool {
if v_0.Op != OpStringMake {
break
}
_ = v_0.Args[1]
len := v_0.Args[1]
v.reset(OpCopy)
v.Type = len.Type

View File

@ -143,9 +143,8 @@ func rewriteValuedec64_OpAdd64_0(v *Value) bool {
// cond:
// result: (Int64Make (Add32withcarry <typ.Int32> (Int64Hi x) (Int64Hi y) (Select1 <types.TypeFlags> (Add32carry (Int64Lo x) (Int64Lo y)))) (Select0 <typ.UInt32> (Add32carry (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpAdd32withcarry, typ.Int32)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -185,9 +184,8 @@ func rewriteValuedec64_OpAnd64_0(v *Value) bool {
// cond:
// result: (Int64Make (And32 <typ.UInt32> (Int64Hi x) (Int64Hi y)) (And32 <typ.UInt32> (Int64Lo x) (Int64Lo y)))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpAnd32, typ.UInt32)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -459,9 +457,8 @@ func rewriteValuedec64_OpEq64_0(v *Value) bool {
// cond:
// result: (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Eq32 (Int64Lo x) (Int64Lo y)))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpAndB)
v0 := b.NewValue0(v.Pos, OpEq32, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -489,9 +486,8 @@ func rewriteValuedec64_OpGeq64_0(v *Value) bool {
// cond:
// result: (OrB (Greater32 (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Geq32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpGreater32, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -529,9 +525,8 @@ func rewriteValuedec64_OpGeq64U_0(v *Value) bool {
// cond:
// result: (OrB (Greater32U (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Geq32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpGreater32U, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -569,9 +564,8 @@ func rewriteValuedec64_OpGreater64_0(v *Value) bool {
// cond:
// result: (OrB (Greater32 (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Greater32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpGreater32, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -609,9 +603,8 @@ func rewriteValuedec64_OpGreater64U_0(v *Value) bool {
// cond:
// result: (OrB (Greater32U (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Greater32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpGreater32U, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -669,7 +662,6 @@ func rewriteValuedec64_OpInt64Lo_0(v *Value) bool {
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
lo := v_0.Args[1]
v.reset(OpCopy)
v.Type = lo.Type
@ -685,9 +677,8 @@ func rewriteValuedec64_OpLeq64_0(v *Value) bool {
// cond:
// result: (OrB (Less32 (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Leq32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpLess32, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -725,9 +716,8 @@ func rewriteValuedec64_OpLeq64U_0(v *Value) bool {
// cond:
// result: (OrB (Less32U (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Leq32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpLess32U, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -765,9 +755,8 @@ func rewriteValuedec64_OpLess64_0(v *Value) bool {
// cond:
// result: (OrB (Less32 (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Less32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpLess32, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -805,9 +794,8 @@ func rewriteValuedec64_OpLess64U_0(v *Value) bool {
// cond:
// result: (OrB (Less32U (Int64Hi x) (Int64Hi y)) (AndB (Eq32 (Int64Hi x) (Int64Hi y)) (Less32U (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpLess32U, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -847,9 +835,8 @@ func rewriteValuedec64_OpLoad_0(v *Value) bool {
// result: (Int64Make (Load <typ.Int32> (OffPtr <typ.Int32Ptr> [4] ptr) mem) (Load <typ.UInt32> ptr mem))
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(is64BitInt(t) && !config.BigEndian && t.IsSigned()) {
break
}
@ -872,9 +859,8 @@ func rewriteValuedec64_OpLoad_0(v *Value) bool {
// result: (Int64Make (Load <typ.UInt32> (OffPtr <typ.UInt32Ptr> [4] ptr) mem) (Load <typ.UInt32> ptr mem))
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(is64BitInt(t) && !config.BigEndian && !t.IsSigned()) {
break
}
@ -897,9 +883,8 @@ func rewriteValuedec64_OpLoad_0(v *Value) bool {
// result: (Int64Make (Load <typ.Int32> ptr mem) (Load <typ.UInt32> (OffPtr <typ.UInt32Ptr> [4] ptr) mem))
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(is64BitInt(t) && config.BigEndian && t.IsSigned()) {
break
}
@ -922,9 +907,8 @@ func rewriteValuedec64_OpLoad_0(v *Value) bool {
// result: (Int64Make (Load <typ.UInt32> ptr mem) (Load <typ.UInt32> (OffPtr <typ.UInt32Ptr> [4] ptr) mem))
for {
t := v.Type
_ = v.Args[1]
ptr := v.Args[0]
mem := v.Args[1]
ptr := v.Args[0]
if !(is64BitInt(t) && config.BigEndian && !t.IsSigned()) {
break
}
@ -979,7 +963,7 @@ func rewriteValuedec64_OpLsh16x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -987,7 +971,6 @@ func rewriteValuedec64_OpLsh16x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpLsh16x32)
v.AddArg(x)
v.AddArg(lo)
@ -1003,9 +986,8 @@ func rewriteValuedec64_OpLsh16x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1056,7 +1038,7 @@ func rewriteValuedec64_OpLsh32x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1064,7 +1046,6 @@ func rewriteValuedec64_OpLsh32x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpLsh32x32)
v.AddArg(x)
v.AddArg(lo)
@ -1080,9 +1061,8 @@ func rewriteValuedec64_OpLsh32x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1105,15 +1085,13 @@ func rewriteValuedec64_OpLsh64x16_0(v *Value) bool {
// cond:
// result: (Int64Make (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Lsh32x16 <typ.UInt32> hi s) (Rsh32Ux16 <typ.UInt32> lo (Sub16 <typ.UInt16> (Const16 <typ.UInt16> [32]) s))) (Lsh32x16 <typ.UInt32> lo (Sub16 <typ.UInt16> s (Const16 <typ.UInt16> [32])))) (Lsh32x16 <typ.UInt32> lo s))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpOr32, typ.UInt32)
v1 := b.NewValue0(v.Pos, OpOr32, typ.UInt32)
@ -1156,15 +1134,13 @@ func rewriteValuedec64_OpLsh64x32_0(v *Value) bool {
// cond:
// result: (Int64Make (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Lsh32x32 <typ.UInt32> hi s) (Rsh32Ux32 <typ.UInt32> lo (Sub32 <typ.UInt32> (Const32 <typ.UInt32> [32]) s))) (Lsh32x32 <typ.UInt32> lo (Sub32 <typ.UInt32> s (Const32 <typ.UInt32> [32])))) (Lsh32x32 <typ.UInt32> lo s))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpOr32, typ.UInt32)
v1 := b.NewValue0(v.Pos, OpOr32, typ.UInt32)
@ -1235,7 +1211,7 @@ func rewriteValuedec64_OpLsh64x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1243,7 +1219,6 @@ func rewriteValuedec64_OpLsh64x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpLsh64x32)
v.AddArg(x)
v.AddArg(lo)
@ -1259,9 +1234,8 @@ func rewriteValuedec64_OpLsh64x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1284,15 +1258,13 @@ func rewriteValuedec64_OpLsh64x8_0(v *Value) bool {
// cond:
// result: (Int64Make (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Lsh32x8 <typ.UInt32> hi s) (Rsh32Ux8 <typ.UInt32> lo (Sub8 <typ.UInt8> (Const8 <typ.UInt8> [32]) s))) (Lsh32x8 <typ.UInt32> lo (Sub8 <typ.UInt8> s (Const8 <typ.UInt8> [32])))) (Lsh32x8 <typ.UInt32> lo s))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpOr32, typ.UInt32)
v1 := b.NewValue0(v.Pos, OpOr32, typ.UInt32)
@ -1363,7 +1335,7 @@ func rewriteValuedec64_OpLsh8x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1371,7 +1343,6 @@ func rewriteValuedec64_OpLsh8x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpLsh8x32)
v.AddArg(x)
v.AddArg(lo)
@ -1387,9 +1358,8 @@ func rewriteValuedec64_OpLsh8x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1412,9 +1382,8 @@ func rewriteValuedec64_OpMul64_0(v *Value) bool {
// cond:
// result: (Int64Make (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Int64Lo x) (Int64Hi y)) (Add32 <typ.UInt32> (Mul32 <typ.UInt32> (Int64Hi x) (Int64Lo y)) (Select0 <typ.UInt32> (Mul32uhilo (Int64Lo x) (Int64Lo y))))) (Select1 <typ.UInt32> (Mul32uhilo (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpAdd32, typ.UInt32)
v1 := b.NewValue0(v.Pos, OpMul32, typ.UInt32)
@ -1482,9 +1451,8 @@ func rewriteValuedec64_OpNeq64_0(v *Value) bool {
// cond:
// result: (OrB (Neq32 (Int64Hi x) (Int64Hi y)) (Neq32 (Int64Lo x) (Int64Lo y)))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpOrB)
v0 := b.NewValue0(v.Pos, OpNeq32, typ.Bool)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -1512,9 +1480,8 @@ func rewriteValuedec64_OpOr64_0(v *Value) bool {
// cond:
// result: (Int64Make (Or32 <typ.UInt32> (Int64Hi x) (Int64Hi y)) (Or32 <typ.UInt32> (Int64Lo x) (Int64Lo y)))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpOr32, typ.UInt32)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -1570,7 +1537,7 @@ func rewriteValuedec64_OpRsh16Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1578,7 +1545,6 @@ func rewriteValuedec64_OpRsh16Ux64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh16Ux32)
v.AddArg(x)
v.AddArg(lo)
@ -1594,9 +1560,8 @@ func rewriteValuedec64_OpRsh16Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1650,7 +1615,7 @@ func rewriteValuedec64_OpRsh16x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1658,7 +1623,6 @@ func rewriteValuedec64_OpRsh16x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh16x32)
v.AddArg(x)
v.AddArg(lo)
@ -1674,9 +1638,8 @@ func rewriteValuedec64_OpRsh16x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1727,7 +1690,7 @@ func rewriteValuedec64_OpRsh32Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1735,7 +1698,6 @@ func rewriteValuedec64_OpRsh32Ux64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh32Ux32)
v.AddArg(x)
v.AddArg(lo)
@ -1751,9 +1713,8 @@ func rewriteValuedec64_OpRsh32Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1805,7 +1766,7 @@ func rewriteValuedec64_OpRsh32x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1813,7 +1774,6 @@ func rewriteValuedec64_OpRsh32x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh32x32)
v.AddArg(x)
v.AddArg(lo)
@ -1829,9 +1789,8 @@ func rewriteValuedec64_OpRsh32x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -1854,15 +1813,13 @@ func rewriteValuedec64_OpRsh64Ux16_0(v *Value) bool {
// cond:
// result: (Int64Make (Rsh32Ux16 <typ.UInt32> hi s) (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Rsh32Ux16 <typ.UInt32> lo s) (Lsh32x16 <typ.UInt32> hi (Sub16 <typ.UInt16> (Const16 <typ.UInt16> [32]) s))) (Rsh32Ux16 <typ.UInt32> hi (Sub16 <typ.UInt16> s (Const16 <typ.UInt16> [32])))))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpRsh32Ux16, typ.UInt32)
v0.AddArg(hi)
@ -1905,15 +1862,13 @@ func rewriteValuedec64_OpRsh64Ux32_0(v *Value) bool {
// cond:
// result: (Int64Make (Rsh32Ux32 <typ.UInt32> hi s) (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Rsh32Ux32 <typ.UInt32> lo s) (Lsh32x32 <typ.UInt32> hi (Sub32 <typ.UInt32> (Const32 <typ.UInt32> [32]) s))) (Rsh32Ux32 <typ.UInt32> hi (Sub32 <typ.UInt32> s (Const32 <typ.UInt32> [32])))))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpRsh32Ux32, typ.UInt32)
v0.AddArg(hi)
@ -1984,7 +1939,7 @@ func rewriteValuedec64_OpRsh64Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -1992,7 +1947,6 @@ func rewriteValuedec64_OpRsh64Ux64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh64Ux32)
v.AddArg(x)
v.AddArg(lo)
@ -2008,9 +1962,8 @@ func rewriteValuedec64_OpRsh64Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -2033,15 +1986,13 @@ func rewriteValuedec64_OpRsh64Ux8_0(v *Value) bool {
// cond:
// result: (Int64Make (Rsh32Ux8 <typ.UInt32> hi s) (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Rsh32Ux8 <typ.UInt32> lo s) (Lsh32x8 <typ.UInt32> hi (Sub8 <typ.UInt8> (Const8 <typ.UInt8> [32]) s))) (Rsh32Ux8 <typ.UInt32> hi (Sub8 <typ.UInt8> s (Const8 <typ.UInt8> [32])))))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpRsh32Ux8, typ.UInt32)
v0.AddArg(hi)
@ -2084,15 +2035,13 @@ func rewriteValuedec64_OpRsh64x16_0(v *Value) bool {
// cond:
// result: (Int64Make (Rsh32x16 <typ.UInt32> hi s) (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Rsh32Ux16 <typ.UInt32> lo s) (Lsh32x16 <typ.UInt32> hi (Sub16 <typ.UInt16> (Const16 <typ.UInt16> [32]) s))) (And32 <typ.UInt32> (Rsh32x16 <typ.UInt32> hi (Sub16 <typ.UInt16> s (Const16 <typ.UInt16> [32]))) (Zeromask (ZeroExt16to32 (Rsh16Ux32 <typ.UInt16> s (Const32 <typ.UInt32> [5])))))))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpRsh32x16, typ.UInt32)
v0.AddArg(hi)
@ -2147,15 +2096,13 @@ func rewriteValuedec64_OpRsh64x32_0(v *Value) bool {
// cond:
// result: (Int64Make (Rsh32x32 <typ.UInt32> hi s) (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Rsh32Ux32 <typ.UInt32> lo s) (Lsh32x32 <typ.UInt32> hi (Sub32 <typ.UInt32> (Const32 <typ.UInt32> [32]) s))) (And32 <typ.UInt32> (Rsh32x32 <typ.UInt32> hi (Sub32 <typ.UInt32> s (Const32 <typ.UInt32> [32]))) (Zeromask (Rsh32Ux32 <typ.UInt32> s (Const32 <typ.UInt32> [5]))))))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpRsh32x32, typ.UInt32)
v0.AddArg(hi)
@ -2246,7 +2193,7 @@ func rewriteValuedec64_OpRsh64x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -2254,7 +2201,6 @@ func rewriteValuedec64_OpRsh64x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh64x32)
v.AddArg(x)
v.AddArg(lo)
@ -2270,9 +2216,8 @@ func rewriteValuedec64_OpRsh64x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -2295,15 +2240,13 @@ func rewriteValuedec64_OpRsh64x8_0(v *Value) bool {
// cond:
// result: (Int64Make (Rsh32x8 <typ.UInt32> hi s) (Or32 <typ.UInt32> (Or32 <typ.UInt32> (Rsh32Ux8 <typ.UInt32> lo s) (Lsh32x8 <typ.UInt32> hi (Sub8 <typ.UInt8> (Const8 <typ.UInt8> [32]) s))) (And32 <typ.UInt32> (Rsh32x8 <typ.UInt32> hi (Sub8 <typ.UInt8> s (Const8 <typ.UInt8> [32]))) (Zeromask (ZeroExt8to32 (Rsh8Ux32 <typ.UInt8> s (Const32 <typ.UInt32> [5])))))))
for {
_ = v.Args[1]
s := v.Args[1]
v_0 := v.Args[0]
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
hi := v_0.Args[0]
lo := v_0.Args[1]
s := v.Args[1]
hi := v_0.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpRsh32x8, typ.UInt32)
v0.AddArg(hi)
@ -2386,7 +2329,7 @@ func rewriteValuedec64_OpRsh8Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -2394,7 +2337,6 @@ func rewriteValuedec64_OpRsh8Ux64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh8Ux32)
v.AddArg(x)
v.AddArg(lo)
@ -2410,9 +2352,8 @@ func rewriteValuedec64_OpRsh8Ux64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -2466,7 +2407,7 @@ func rewriteValuedec64_OpRsh8x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
lo := v_1.Args[1]
v_1_0 := v_1.Args[0]
if v_1_0.Op != OpConst32 {
break
@ -2474,7 +2415,6 @@ func rewriteValuedec64_OpRsh8x64_0(v *Value) bool {
if v_1_0.AuxInt != 0 {
break
}
lo := v_1.Args[1]
v.reset(OpRsh8x32)
v.AddArg(x)
v.AddArg(lo)
@ -2490,9 +2430,8 @@ func rewriteValuedec64_OpRsh8x64_0(v *Value) bool {
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
hi := v_1.Args[0]
if !(hi.Op != OpConst32) {
break
}
@ -2562,16 +2501,14 @@ func rewriteValuedec64_OpStore_0(v *Value) bool {
// result: (Store {hi.Type} (OffPtr <hi.Type.PtrTo()> [4] dst) hi (Store {lo.Type} dst lo mem))
for {
t := v.Aux
_ = v.Args[2]
mem := v.Args[2]
dst := v.Args[0]
v_1 := v.Args[1]
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
mem := v.Args[2]
hi := v_1.Args[0]
if !(t.(*types.Type).Size() == 8 && !config.BigEndian) {
break
}
@ -2595,16 +2532,14 @@ func rewriteValuedec64_OpStore_0(v *Value) bool {
// result: (Store {lo.Type} (OffPtr <lo.Type.PtrTo()> [4] dst) lo (Store {hi.Type} dst hi mem))
for {
t := v.Aux
_ = v.Args[2]
mem := v.Args[2]
dst := v.Args[0]
v_1 := v.Args[1]
if v_1.Op != OpInt64Make {
break
}
_ = v_1.Args[1]
hi := v_1.Args[0]
lo := v_1.Args[1]
mem := v.Args[2]
hi := v_1.Args[0]
if !(t.(*types.Type).Size() == 8 && config.BigEndian) {
break
}
@ -2632,9 +2567,8 @@ func rewriteValuedec64_OpSub64_0(v *Value) bool {
// cond:
// result: (Int64Make (Sub32withcarry <typ.Int32> (Int64Hi x) (Int64Hi y) (Select1 <types.TypeFlags> (Sub32carry (Int64Lo x) (Int64Lo y)))) (Select0 <typ.UInt32> (Sub32carry (Int64Lo x) (Int64Lo y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpSub32withcarry, typ.Int32)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)
@ -2676,7 +2610,6 @@ func rewriteValuedec64_OpTrunc64to16_0(v *Value) bool {
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
lo := v_0.Args[1]
v.reset(OpTrunc32to16)
v.AddArg(lo)
@ -2693,7 +2626,6 @@ func rewriteValuedec64_OpTrunc64to32_0(v *Value) bool {
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
lo := v_0.Args[1]
v.reset(OpCopy)
v.Type = lo.Type
@ -2711,7 +2643,6 @@ func rewriteValuedec64_OpTrunc64to8_0(v *Value) bool {
if v_0.Op != OpInt64Make {
break
}
_ = v_0.Args[1]
lo := v_0.Args[1]
v.reset(OpTrunc32to8)
v.AddArg(lo)
@ -2726,9 +2657,8 @@ func rewriteValuedec64_OpXor64_0(v *Value) bool {
// cond:
// result: (Int64Make (Xor32 <typ.UInt32> (Int64Hi x) (Int64Hi y)) (Xor32 <typ.UInt32> (Int64Lo x) (Int64Lo y)))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
x := v.Args[0]
v.reset(OpInt64Make)
v0 := b.NewValue0(v.Pos, OpXor32, typ.UInt32)
v1 := b.NewValue0(v.Pos, OpInt64Hi, typ.UInt32)

File diff suppressed because it is too large Load Diff