peepmatic: Introduce the main peepmatic crate

Peepmatic is a DSL for peephole optimizations and compiler for generating
peephole optimizers from them. The user writes a set of optimizations in the
DSL, and then `peepmatic` compiles the set of optimizations into an efficient
peephole optimizer:

```
DSL ----peepmatic----> Peephole Optimizer
```

The generated peephole optimizer has all of its optimizations' left-hand sides
collapsed into a compact automata that makes matching candidate instruction
sequences fast.

The DSL's optimizations may be written by hand or discovered mechanically with a
superoptimizer like [Souper][]. Eventually, `peepmatic` should have a verifier
that ensures that the DSL's optimizations are sound, similar to what [Alive][]
does for LLVM optimizations.

[Souper]: https://github.com/google/souper
[Alive]: https://github.com/AliveToolkit/alive2
This commit is contained in:
Nick Fitzgerald
2020-05-01 15:41:06 -07:00
parent 197a9e88cb
commit de9fc63009
16 changed files with 5422 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
[package]
name = "peepmatic"
version = "0.1.0"
authors = ["Nick Fitzgerald <fitzgen@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.27"
peepmatic-automata = { version = "0.1.0", path = "crates/automata", features = ["dot"] }
peepmatic-macro = { version = "0.1.0", path = "crates/macro" }
peepmatic-runtime = { version = "0.1.0", path = "crates/runtime", features = ["construct"] }
wast = "13.0.0"
z3 = { version = "0.5.0", features = ["static-link-z3"] }