cranelift: Don't build peepmatic-based optimizations in build.rs

Instead, when the `rebuild-peephole-optimizers` feature is enabled, rebuild them
the first time they are used. This allows peepmatic to run when Cranelift's
`Opcode` is defined and available, which paves the way forward for:

* merging `peepmatic_runtime::operator::Operator` and Cranelift's `Opcode` (we
  are wasting a bunch of cycles converting between the two of them), and

* supporting vcode optimizations in `peepmatic`.
This commit is contained in:
Nick Fitzgerald
2020-06-29 15:58:08 -07:00
parent 978070c020
commit ae95ad8733
4 changed files with 59 additions and 27 deletions

View File

@@ -25,6 +25,7 @@ gimli = { version = "0.21.0", default-features = false, features = ["write"], op
smallvec = { version = "1.0.0" }
thiserror = "1.0.4"
byteorder = { version = "1.3.2", default-features = false }
peepmatic = { path = "../peepmatic", optional = true, version = "0.66.0" }
peepmatic-runtime = { path = "../peepmatic/crates/runtime", optional = true, version = "0.2.0" }
regalloc = { version = "0.0.28" }
# It is a goal of the cranelift-codegen crate to have minimal external dependencies.
@@ -34,7 +35,6 @@ regalloc = { version = "0.0.28" }
[build-dependencies]
cranelift-codegen-meta = { path = "meta", version = "0.66.0" }
peepmatic = { path = "../peepmatic", optional = true, version = "0.66.0" }
[features]
default = ["std", "unwind"]