cranelift: Port most of simple_preopt.rs over to the peepmatic DSL

This ports all of the identity, no-op, simplification, and canonicalization
related optimizations over from being hand-coded to the `peepmatic` DSL. This
does not handle the branch-to-branch optimizations or most of the
divide-by-constant optimizations.
This commit is contained in:
Nick Fitzgerald
2020-04-28 16:43:32 -07:00
parent 18663fede9
commit 090d1c2d32
20 changed files with 1289 additions and 488 deletions

View File

@@ -6,9 +6,9 @@ function u0:0(i8) -> i8 fast {
block0(v0: i8):
v1 = iconst.i8 0
v2 = isub v1, v0
; check: v3 = uextend.i32 v0
; nextln: v5 = iconst.i32 0
; nextln = isub v5, v3
; nextln = ireduce.i8 v4
; check: v4 = uextend.i32 v0
; nextln: v6 = iconst.i32 0
; nextln: v5 = isub v6, v4
; nextln: v2 = ireduce.i8 v5
return v2
}