egraphs: Add bmask bit pattern optimization rule (#6196)

* egraphs: Add a bmask bit pattern optimization

* egraphs: Add more `ineg` rules

* egraphs: Add sshr rule

* egraphs: Simplify bmask rule

* egraphs: Add comutative version of bmask rule

* egraphs: Add more testcases

* egraphs: Cleanup rule comments

* egraphs: Add more `ineg` optimizations
This commit is contained in:
Afonso Bordado
2023-04-14 19:50:48 +01:00
committed by GitHub
parent 2d25db047f
commit 9e1ff9726c
7 changed files with 183 additions and 0 deletions

View File

@@ -204,3 +204,14 @@ block0(v0: i8):
; check: v5 = sextend.i64 v0
; check: return v5
}
function %ineg_ushr_to_sshr(i64) -> i64 {
block0(v0: i64):
v1 = iconst.i64 63
v2 = ushr v0, v1
v3 = ineg v2
return v3
; check: v4 = sshr v0, v1
; check: return v4
}