mirror of
https://github.com/golang/go
synced 2024-11-19 13:44:52 -07:00
cmd/compile: fix constant propagation through s390x MOVDNE instructions
The constant propagation rules selected the wrong operand to propagate. So MOVDNE (move if not equal) propagated operands as if it were a MOVDEQ (move if equal). Fixes #18735. Change-Id: I87ac469172f9df7d5aabaf7106e2936ce54ae202 Reviewed-on: https://go-review.googlesource.com/35498 Run-TryBot: Michael Munday <munday@ca.ibm.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
1be957d703
commit
4cce27a3fa
@ -885,9 +885,9 @@
|
|||||||
(MOVDEQ y _ (FlagLT)) -> y
|
(MOVDEQ y _ (FlagLT)) -> y
|
||||||
(MOVDEQ y _ (FlagGT)) -> y
|
(MOVDEQ y _ (FlagGT)) -> y
|
||||||
|
|
||||||
(MOVDNE _ y (FlagEQ)) -> y
|
(MOVDNE y _ (FlagEQ)) -> y
|
||||||
(MOVDNE x _ (FlagLT)) -> x
|
(MOVDNE _ x (FlagLT)) -> x
|
||||||
(MOVDNE x _ (FlagGT)) -> x
|
(MOVDNE _ x (FlagGT)) -> x
|
||||||
|
|
||||||
(MOVDLT y _ (FlagEQ)) -> y
|
(MOVDLT y _ (FlagEQ)) -> y
|
||||||
(MOVDLT _ x (FlagLT)) -> x
|
(MOVDLT _ x (FlagLT)) -> x
|
||||||
|
@ -9847,11 +9847,11 @@ func rewriteValueS390X_OpS390XMOVDNE(v *Value, config *Config) bool {
|
|||||||
v.AddArg(cmp)
|
v.AddArg(cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (MOVDNE _ y (FlagEQ))
|
// match: (MOVDNE y _ (FlagEQ))
|
||||||
// cond:
|
// cond:
|
||||||
// result: y
|
// result: y
|
||||||
for {
|
for {
|
||||||
y := v.Args[1]
|
y := v.Args[0]
|
||||||
v_2 := v.Args[2]
|
v_2 := v.Args[2]
|
||||||
if v_2.Op != OpS390XFlagEQ {
|
if v_2.Op != OpS390XFlagEQ {
|
||||||
break
|
break
|
||||||
@ -9861,11 +9861,11 @@ func rewriteValueS390X_OpS390XMOVDNE(v *Value, config *Config) bool {
|
|||||||
v.AddArg(y)
|
v.AddArg(y)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (MOVDNE x _ (FlagLT))
|
// match: (MOVDNE _ x (FlagLT))
|
||||||
// cond:
|
// cond:
|
||||||
// result: x
|
// result: x
|
||||||
for {
|
for {
|
||||||
x := v.Args[0]
|
x := v.Args[1]
|
||||||
v_2 := v.Args[2]
|
v_2 := v.Args[2]
|
||||||
if v_2.Op != OpS390XFlagLT {
|
if v_2.Op != OpS390XFlagLT {
|
||||||
break
|
break
|
||||||
@ -9875,11 +9875,11 @@ func rewriteValueS390X_OpS390XMOVDNE(v *Value, config *Config) bool {
|
|||||||
v.AddArg(x)
|
v.AddArg(x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (MOVDNE x _ (FlagGT))
|
// match: (MOVDNE _ x (FlagGT))
|
||||||
// cond:
|
// cond:
|
||||||
// result: x
|
// result: x
|
||||||
for {
|
for {
|
||||||
x := v.Args[0]
|
x := v.Args[1]
|
||||||
v_2 := v.Args[2]
|
v_2 := v.Args[2]
|
||||||
if v_2.Op != OpS390XFlagGT {
|
if v_2.Op != OpS390XFlagGT {
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user