mirror of
https://github.com/golang/go
synced 2024-11-23 19:30:05 -07:00
cmd/compile: remove order canonicalization rules from mips
CL 38801 introduced automatic commutative rule generation. Manual order canonicalization rules thus lead to infinite loops. Fixes #19842 Change-Id: I877c476152f4d207fdc67bc6f3018265aa9bc5ac Reviewed-on: https://go-review.googlesource.com/39533 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
6c5a819a5e
commit
fc327a14c4
@ -611,9 +611,6 @@
|
||||
(SGTU x (MOVWconst [0])) -> (SGTUzero x)
|
||||
|
||||
// mul with constant
|
||||
(Select1 (MULTU x (MOVWconst [c]))) && x.Op != OpMIPSMOVWconst -> (Select1 (MULTU (MOVWconst [c]) x ))
|
||||
(Select0 (MULTU x (MOVWconst [c]))) && x.Op != OpMIPSMOVWconst -> (Select0 (MULTU (MOVWconst [c]) x ))
|
||||
|
||||
(Select1 (MULTU (MOVWconst [0]) _ )) -> (MOVWconst [0])
|
||||
(Select0 (MULTU (MOVWconst [0]) _ )) -> (MOVWconst [0])
|
||||
(Select1 (MULTU (MOVWconst [1]) x )) -> x
|
||||
|
@ -7886,58 +7886,6 @@ func rewriteValueMIPS_OpSelect0(v *Value) bool {
|
||||
v.AddArg(y)
|
||||
return true
|
||||
}
|
||||
// match: (Select0 (MULTU x (MOVWconst [c])))
|
||||
// cond: x.Op != OpMIPSMOVWconst
|
||||
// result: (Select0 (MULTU (MOVWconst [c]) x ))
|
||||
for {
|
||||
v_0 := v.Args[0]
|
||||
if v_0.Op != OpMIPSMULTU {
|
||||
break
|
||||
}
|
||||
x := v_0.Args[0]
|
||||
v_0_1 := v_0.Args[1]
|
||||
if v_0_1.Op != OpMIPSMOVWconst {
|
||||
break
|
||||
}
|
||||
c := v_0_1.AuxInt
|
||||
if !(x.Op != OpMIPSMOVWconst) {
|
||||
break
|
||||
}
|
||||
v.reset(OpSelect0)
|
||||
v0 := b.NewValue0(v.Pos, OpMIPSMULTU, MakeTuple(types.UInt32, types.UInt32))
|
||||
v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32)
|
||||
v1.AuxInt = c
|
||||
v0.AddArg(v1)
|
||||
v0.AddArg(x)
|
||||
v.AddArg(v0)
|
||||
return true
|
||||
}
|
||||
// match: (Select0 (MULTU (MOVWconst [c]) x))
|
||||
// cond: x.Op != OpMIPSMOVWconst
|
||||
// result: (Select0 (MULTU (MOVWconst [c]) x ))
|
||||
for {
|
||||
v_0 := v.Args[0]
|
||||
if v_0.Op != OpMIPSMULTU {
|
||||
break
|
||||
}
|
||||
v_0_0 := v_0.Args[0]
|
||||
if v_0_0.Op != OpMIPSMOVWconst {
|
||||
break
|
||||
}
|
||||
c := v_0_0.AuxInt
|
||||
x := v_0.Args[1]
|
||||
if !(x.Op != OpMIPSMOVWconst) {
|
||||
break
|
||||
}
|
||||
v.reset(OpSelect0)
|
||||
v0 := b.NewValue0(v.Pos, OpMIPSMULTU, MakeTuple(types.UInt32, types.UInt32))
|
||||
v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32)
|
||||
v1.AuxInt = c
|
||||
v0.AddArg(v1)
|
||||
v0.AddArg(x)
|
||||
v.AddArg(v0)
|
||||
return true
|
||||
}
|
||||
// match: (Select0 (MULTU (MOVWconst [0]) _))
|
||||
// cond:
|
||||
// result: (MOVWconst [0])
|
||||
@ -8247,58 +8195,6 @@ func rewriteValueMIPS_OpSelect1(v *Value) bool {
|
||||
v.AddArg(x)
|
||||
return true
|
||||
}
|
||||
// match: (Select1 (MULTU x (MOVWconst [c])))
|
||||
// cond: x.Op != OpMIPSMOVWconst
|
||||
// result: (Select1 (MULTU (MOVWconst [c]) x ))
|
||||
for {
|
||||
v_0 := v.Args[0]
|
||||
if v_0.Op != OpMIPSMULTU {
|
||||
break
|
||||
}
|
||||
x := v_0.Args[0]
|
||||
v_0_1 := v_0.Args[1]
|
||||
if v_0_1.Op != OpMIPSMOVWconst {
|
||||
break
|
||||
}
|
||||
c := v_0_1.AuxInt
|
||||
if !(x.Op != OpMIPSMOVWconst) {
|
||||
break
|
||||
}
|
||||
v.reset(OpSelect1)
|
||||
v0 := b.NewValue0(v.Pos, OpMIPSMULTU, MakeTuple(types.UInt32, types.UInt32))
|
||||
v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32)
|
||||
v1.AuxInt = c
|
||||
v0.AddArg(v1)
|
||||
v0.AddArg(x)
|
||||
v.AddArg(v0)
|
||||
return true
|
||||
}
|
||||
// match: (Select1 (MULTU (MOVWconst [c]) x))
|
||||
// cond: x.Op != OpMIPSMOVWconst
|
||||
// result: (Select1 (MULTU (MOVWconst [c]) x ))
|
||||
for {
|
||||
v_0 := v.Args[0]
|
||||
if v_0.Op != OpMIPSMULTU {
|
||||
break
|
||||
}
|
||||
v_0_0 := v_0.Args[0]
|
||||
if v_0_0.Op != OpMIPSMOVWconst {
|
||||
break
|
||||
}
|
||||
c := v_0_0.AuxInt
|
||||
x := v_0.Args[1]
|
||||
if !(x.Op != OpMIPSMOVWconst) {
|
||||
break
|
||||
}
|
||||
v.reset(OpSelect1)
|
||||
v0 := b.NewValue0(v.Pos, OpMIPSMULTU, MakeTuple(types.UInt32, types.UInt32))
|
||||
v1 := b.NewValue0(v.Pos, OpMIPSMOVWconst, types.UInt32)
|
||||
v1.AuxInt = c
|
||||
v0.AddArg(v1)
|
||||
v0.AddArg(x)
|
||||
v.AddArg(v0)
|
||||
return true
|
||||
}
|
||||
// match: (Select1 (MULTU (MOVWconst [0]) _))
|
||||
// cond:
|
||||
// result: (MOVWconst [0])
|
||||
|
Loading…
Reference in New Issue
Block a user