Add some minor souper-harvested optimizations (#5735)

I was playing around with souper recently on some wasms I had lying
around and these are some optimization opportunities that popped out
which seemed easy-enough to add to the egraph-based optimizations.
This commit is contained in:
Alex Crichton
2023-02-07 14:06:24 -06:00
committed by GitHub
parent 08403c9915
commit 72962c9f08
3 changed files with 134 additions and 0 deletions

View File

@@ -110,6 +110,10 @@
(bxor ty k @ (iconst ty _) x))
(bxor ty x k))
(rule (simplify
(icmp ty cc k @ (iconst _ _) x))
(icmp ty (intcc_reverse cc) x k))
;; Canonicalize via associativity: reassociate to a right-heavy tree
;; for constants.
;;