[][src]Struct peepmatic_runtime::optimizations::PeepholeOptimizations

pub struct PeepholeOptimizations {
    pub paths: PathInterner,
    pub integers: IntegerInterner,
    pub automata: Automaton<MatchResult, MatchOp, Box<[Action]>>,
}

A compiled set of peephole optimizations.

This is the compilation result of the peepmatic crate, after its taken a bunch of optimizations written in the DSL and lowered and combined them.

Fields

paths: PathInterner

The instruction paths referenced by the peephole optimizations.

integers: IntegerInterner

Not all integers we're matching on fit in the u32 that we use as the result of match operations. So we intern them and refer to them by id.

automata: Automaton<MatchResult, MatchOp, Box<[Action]>>

The underlying automata for matching optimizations' left-hand sides, and building up the corresponding right-hand side.

Implementations

impl PeepholeOptimizations[src]

pub fn deserialize(serialized: &[u8]) -> Result<Self>[src]

Deserialize a PeepholeOptimizations from bytes.

pub fn optimizer<'peep, 'ctx, I>(
    &'peep self,
    instr_set: I
) -> PeepholeOptimizer<'peep, 'ctx, I> where
    I: InstructionSet<'ctx>, 
[src]

Create a new peephole optimizer instance from this set of peephole optimizations.

The peephole optimizer instance can be used to apply these peephole optimizations. When checking multiple instructions for whether they can be optimized, it is more performant to reuse a single peephole optimizer instance, rather than create a new one for each instruction. Reusing the peephole optimizer instance allows the reuse of a few internal allocations.

Trait Implementations

impl Debug for PeepholeOptimizations[src]

impl<'de> Deserialize<'de> for PeepholeOptimizations[src]

impl Serialize for PeepholeOptimizations[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.