Struct peepmatic_runtime::optimizer::PeepholeOptimizer[][src]

pub struct PeepholeOptimizer<'peep, 'ctx, TInstructionSet> where
    TInstructionSet: InstructionSet<'ctx>, 
{ /* fields omitted */ }
Expand description

A peephole optimizer instance that can apply a set of peephole optimizations to instructions.

These are created from a set of peephole optimizations with the PeepholeOptimizations::optimizer method.

Reusing an instance when applying peephole optimizations to different instruction sequences means that you reuse internal allocations that are used to match left-hand sides and build up right-hand sides.

Implementations

Attempt to apply a single peephole optimization to the given root instruction.

If an optimization is applied, then the root is replaced with the optimization’s right-hand side, and the root of the right-hand side is returned as Some.

If no optimization’s left-hand side matches root, then root is left untouched and None is returned.

Keep applying peephole optimizations to the given instruction until none can be applied anymore.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.