Cranelift: Collapse double extends into a single extend (#5772)

This commit is contained in:
Nick Fitzgerald
2023-02-13 14:43:17 -08:00
committed by GitHub
parent 91c8114f00
commit 6df3bbbe60
2 changed files with 26 additions and 0 deletions

View File

@@ -6,6 +6,12 @@
;; than a piece of the input or a new node that we construct; but we
;; can freely rewrite e.g. `x+y-y` to `x`.
;; Chained `uextend` and `sextend`.
(rule (simplify (uextend ty (uextend _intermediate_ty x)))
(uextend ty x))
(rule (simplify (sextend ty (sextend _intermediate_ty x)))
(sextend ty x))
;; x+0 == 0+x == x.
(rule (simplify (iadd ty
x