cranelift: simplify ineg(ineg(x)) to x (#6033)
This commit is contained in:
@@ -32,6 +32,9 @@
|
|||||||
x))
|
x))
|
||||||
(ineg ty x))
|
(ineg ty x))
|
||||||
|
|
||||||
|
;; ineg(ineg(x)) == x.
|
||||||
|
(rule (simplify (ineg ty (ineg ty x))) (subsume x))
|
||||||
|
|
||||||
;; x*1 == 1*x == x.
|
;; x*1 == 1*x == x.
|
||||||
(rule (simplify (imul ty
|
(rule (simplify (imul ty
|
||||||
x
|
x
|
||||||
|
|||||||
@@ -224,6 +224,14 @@ block0(v0: i8):
|
|||||||
; check: return v5
|
; check: return v5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function %double_ineg(i32) -> i32 {
|
||||||
|
block0(v0: i32):
|
||||||
|
v1 = ineg v0
|
||||||
|
v2 = ineg v1
|
||||||
|
return v2
|
||||||
|
; check: return v0
|
||||||
|
}
|
||||||
|
|
||||||
function %or_and_y_with_not_y_i8(i8, i8) -> i8 {
|
function %or_and_y_with_not_y_i8(i8, i8) -> i8 {
|
||||||
block0(v0: i8, v1: i8):
|
block0(v0: i8, v1: i8):
|
||||||
v2 = band v0, v1
|
v2 = band v0, v1
|
||||||
|
|||||||
Reference in New Issue
Block a user