Files
wasmtime/cranelift/peepmatic/crates/runtime/src/lib.rs
Nick Fitzgerald c015d69eb8 peepmatic: Do not use paths in linear IR
Rather than using paths from the root instruction to the instruction we are
matching against or checking if it is constant or whatever, use temporary
variables. When we successfully match an instruction's opcode, we simultaneously
define these temporaries for the instruction's operands. This is similar to how
open-coding these matches in Rust would use `match` expressions with pattern
matching to bind the operands to variables at the same time.

This saves about 1.8% of instructions retired when Peepmatic is enabled.
2020-10-13 11:03:48 -07:00

34 lines
991 B
Rust

//! Runtime support for `peepmatic`'s peephole optimizers.
//!
//! This crate contains everything required to use a `peepmatic`-generated
//! peephole optimizer.
//!
//! ## Why is this a different crate from `peepmatic`?
//!
//! In short: build times and code size.
//!
//! If you are just using a peephole optimizer, you shouldn't need the functions
//! to construct it from scratch from the DSL (and the implied code size and
//! compilation time), let alone even build it at all. You should just
//! deserialize an already-built peephole optimizer, and then use it.
//!
//! That's all that is contained here in this crate.
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
pub mod cc;
pub mod error;
pub mod instruction_set;
pub mod integer_interner;
pub mod linear;
pub mod optimizations;
pub mod optimizer;
pub mod part;
pub mod r#type;
pub mod unquote;
pub use error::{Error, Result};
pub use optimizations::PeepholeOptimizations;
pub use optimizer::PeepholeOptimizer;