Constant-fold icmp instructions (#5666)
We found examples of icmp instructions with both operands constant in spidermonkey.wasm.
This commit is contained in:
@@ -70,6 +70,14 @@
|
||||
(iconst ty k2)))
|
||||
(subsume (iconst ty (imm64_sshr ty k1 k2))))
|
||||
|
||||
(rule (simplify
|
||||
(icmp result_ty
|
||||
cc
|
||||
(iconst ty k1)
|
||||
(iconst ty k2)))
|
||||
(subsume (iconst result_ty (imm64_icmp ty cc k1 k2))))
|
||||
|
||||
|
||||
;; Canonicalize via commutativity: push immediates to the right.
|
||||
;;
|
||||
;; (op k x) --> (op x k)
|
||||
|
||||
Reference in New Issue
Block a user