aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/rewriteRISCV64.go
diff options
context:
space:
mode:
authorMichael Munday <mike.munday@ibm.com>2020-02-20 17:46:08 +0000
committerMichael Munday <mike.munday@ibm.com>2020-02-26 13:11:53 +0000
commitcb74dcc172de2779a2f65ea830f687156c98ad50 (patch)
treef94450c829e15288289bcf99f27b91ede70954eb /src/cmd/compile/internal/ssa/rewriteRISCV64.go
parent44fe355694798b5e1c55fc087e697886e93e633e (diff)
downloadgo-cb74dcc172de2779a2f65ea830f687156c98ad50.tar.gz
go-cb74dcc172de2779a2f65ea830f687156c98ad50.zip
cmd/compile: remove Greater* and Geq* generic integer ops
The generic Greater and Geq ops can always be replaced with the Less and Leq ops. This CL therefore removes them. This simplifies the compiler since it reduces the number of operations that need handling in both code and in rewrite rules. This will be especially true when adding control flow optimizations such as the integer-in-range optimizations in CL 165998. Change-Id: If0648b2b19998ac1bddccbf251283f3be4ec3040 Reviewed-on: https://go-review.googlesource.com/c/go/+/220417 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewriteRISCV64.go')
-rw-r--r--src/cmd/compile/internal/ssa/rewriteRISCV64.go288
1 files changed, 0 insertions, 288 deletions
diff --git a/src/cmd/compile/internal/ssa/rewriteRISCV64.go b/src/cmd/compile/internal/ssa/rewriteRISCV64.go
index fd3e62b819..fe1604eca5 100644
--- a/src/cmd/compile/internal/ssa/rewriteRISCV64.go
+++ b/src/cmd/compile/internal/ssa/rewriteRISCV64.go
@@ -156,26 +156,10 @@ func rewriteValueRISCV64(v *Value) bool {
return rewriteValueRISCV64_OpEqB(v)
case OpEqPtr:
return rewriteValueRISCV64_OpEqPtr(v)
- case OpGeq16:
- return rewriteValueRISCV64_OpGeq16(v)
- case OpGeq16U:
- return rewriteValueRISCV64_OpGeq16U(v)
- case OpGeq32:
- return rewriteValueRISCV64_OpGeq32(v)
case OpGeq32F:
return rewriteValueRISCV64_OpGeq32F(v)
- case OpGeq32U:
- return rewriteValueRISCV64_OpGeq32U(v)
- case OpGeq64:
- return rewriteValueRISCV64_OpGeq64(v)
case OpGeq64F:
return rewriteValueRISCV64_OpGeq64F(v)
- case OpGeq64U:
- return rewriteValueRISCV64_OpGeq64U(v)
- case OpGeq8:
- return rewriteValueRISCV64_OpGeq8(v)
- case OpGeq8U:
- return rewriteValueRISCV64_OpGeq8U(v)
case OpGetCallerPC:
v.Op = OpRISCV64LoweredGetCallerPC
return true
@@ -185,26 +169,10 @@ func rewriteValueRISCV64(v *Value) bool {
case OpGetClosurePtr:
v.Op = OpRISCV64LoweredGetClosurePtr
return true
- case OpGreater16:
- return rewriteValueRISCV64_OpGreater16(v)
- case OpGreater16U:
- return rewriteValueRISCV64_OpGreater16U(v)
- case OpGreater32:
- return rewriteValueRISCV64_OpGreater32(v)
case OpGreater32F:
return rewriteValueRISCV64_OpGreater32F(v)
- case OpGreater32U:
- return rewriteValueRISCV64_OpGreater32U(v)
- case OpGreater64:
- return rewriteValueRISCV64_OpGreater64(v)
case OpGreater64F:
return rewriteValueRISCV64_OpGreater64F(v)
- case OpGreater64U:
- return rewriteValueRISCV64_OpGreater64U(v)
- case OpGreater8:
- return rewriteValueRISCV64_OpGreater8(v)
- case OpGreater8U:
- return rewriteValueRISCV64_OpGreater8U(v)
case OpHmul32:
return rewriteValueRISCV64_OpHmul32(v)
case OpHmul32u:
@@ -937,60 +905,6 @@ func rewriteValueRISCV64_OpEqPtr(v *Value) bool {
return true
}
}
-func rewriteValueRISCV64_OpGeq16(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq16 x y)
- // result: (Not (Less16 x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess16, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValueRISCV64_OpGeq16U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq16U x y)
- // result: (Not (Less16U x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess16U, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValueRISCV64_OpGeq32(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq32 x y)
- // result: (Not (Less32 x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess32, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
func rewriteValueRISCV64_OpGeq32F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -1005,42 +919,6 @@ func rewriteValueRISCV64_OpGeq32F(v *Value) bool {
return true
}
}
-func rewriteValueRISCV64_OpGeq32U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq32U x y)
- // result: (Not (Less32U x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess32U, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValueRISCV64_OpGeq64(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq64 x y)
- // result: (Not (Less64 x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess64, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
func rewriteValueRISCV64_OpGeq64F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -1055,102 +933,6 @@ func rewriteValueRISCV64_OpGeq64F(v *Value) bool {
return true
}
}
-func rewriteValueRISCV64_OpGeq64U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq64U x y)
- // result: (Not (Less64U x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess64U, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValueRISCV64_OpGeq8(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq8 x y)
- // result: (Not (Less8 x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess8, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValueRISCV64_OpGeq8U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (Geq8U x y)
- // result: (Not (Less8U x y))
- for {
- x := v_0
- y := v_1
- v.reset(OpNot)
- v0 := b.NewValue0(v.Pos, OpLess8U, typ.Bool)
- v0.AddArg(x)
- v0.AddArg(y)
- v.AddArg(v0)
- return true
- }
-}
-func rewriteValueRISCV64_OpGreater16(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater16 x y)
- // result: (Less16 y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess16)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
-func rewriteValueRISCV64_OpGreater16U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater16U x y)
- // result: (Less16U y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess16U)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
-func rewriteValueRISCV64_OpGreater32(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater32 x y)
- // result: (Less32 y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess32)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
func rewriteValueRISCV64_OpGreater32F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -1165,34 +947,6 @@ func rewriteValueRISCV64_OpGreater32F(v *Value) bool {
return true
}
}
-func rewriteValueRISCV64_OpGreater32U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater32U x y)
- // result: (Less32U y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess32U)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
-func rewriteValueRISCV64_OpGreater64(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater64 x y)
- // result: (Less64 y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess64)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
func rewriteValueRISCV64_OpGreater64F(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
@@ -1207,48 +961,6 @@ func rewriteValueRISCV64_OpGreater64F(v *Value) bool {
return true
}
}
-func rewriteValueRISCV64_OpGreater64U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater64U x y)
- // result: (Less64U y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess64U)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
-func rewriteValueRISCV64_OpGreater8(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater8 x y)
- // result: (Less8 y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess8)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
-func rewriteValueRISCV64_OpGreater8U(v *Value) bool {
- v_1 := v.Args[1]
- v_0 := v.Args[0]
- // match: (Greater8U x y)
- // result: (Less8U y x)
- for {
- x := v_0
- y := v_1
- v.reset(OpLess8U)
- v.AddArg(y)
- v.AddArg(x)
- return true
- }
-}
func rewriteValueRISCV64_OpHmul32(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]