Constant-fold icmp instructions (#5666)

We found examples of icmp instructions with both operands constant in
spidermonkey.wasm.
This commit is contained in:
Jamey Sharp
2023-02-01 13:55:36 -08:00
committed by GitHub
parent bdfb746548
commit ac4d28f4dd
5 changed files with 161 additions and 18 deletions

View File

@@ -192,3 +192,21 @@ block0(v0: i64):
return v4
; check: return v4
}
function %f2(i8) -> i8 {
block0(v1: i8):
v2 = icmp eq v1, v1
return v2
}
; check: v3 = iconst.i8 1
; check: return v3
function %f3(i8) -> i8 {
block0(v1: i8):
v2 = icmp ne v1, v1
return v2
}
; check: v3 = iconst.i8 0
; check: return v3