]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove order canonicalization rules from mips
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 4 Apr 2017 22:26:04 +0000 (15:26 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 4 Apr 2017 23:17:23 +0000 (23:17 +0000)
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>
src/cmd/compile/internal/ssa/gen/MIPS.rules
src/cmd/compile/internal/ssa/rewriteMIPS.go

index ec875ddea3341a174f132e10dfad698d94551ae7..5124daa48de819d2e0a9ec41aae152cd38355b6d 100644 (file)
 (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
index 082c67ad7828d883bfab74c3011db7d51e9dd452..740b62a83f485a200604cd286424d7f2e660bab3 100644 (file)
@@ -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])