Commit fc327a14 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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: default avatarKeith Randall <khr@golang.org>
parent 6c5a819a
......@@ -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])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment