[−][src]Struct peepmatic_runtime::optimizations::PeepholeOptimizations
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
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<TOperator>]>>
The underlying automata for matching optimizations' left-hand sides, and building up the corresponding right-hand side.
Implementations
impl<TOperator> PeepholeOptimizations<TOperator> where
TOperator: 'static + Copy + Debug + Eq + Hash,
[src]
TOperator: 'static + Copy + Debug + Eq + Hash,
pub fn deserialize<'a>(serialized: &'a [u8]) -> Result<Self> where
TOperator: Deserialize<'a>,
[src]
TOperator: Deserialize<'a>,
Deserialize a PeepholeOptimizations
from bytes.
impl<TOperator> PeepholeOptimizations<TOperator> where
TOperator: 'static + Copy + Debug + Eq + Hash,
[src]
TOperator: 'static + Copy + Debug + Eq + Hash,
pub fn optimizer<'peep, 'ctx, TInstructionSet>(
&'peep self,
instr_set: TInstructionSet
) -> PeepholeOptimizer<'peep, 'ctx, TInstructionSet> where
TInstructionSet: InstructionSet<'ctx, Operator = TOperator>,
TOperator: Into<NonZeroU32>,
[src]
&'peep self,
instr_set: TInstructionSet
) -> PeepholeOptimizer<'peep, 'ctx, TInstructionSet> where
TInstructionSet: InstructionSet<'ctx, Operator = TOperator>,
TOperator: Into<NonZeroU32>,
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<TOperator: Debug> Debug for PeepholeOptimizations<TOperator> where
TOperator: 'static + Copy + Debug + Eq + Hash,
[src]
TOperator: 'static + Copy + Debug + Eq + Hash,
impl<'de, TOperator> Deserialize<'de> for PeepholeOptimizations<TOperator> where
TOperator: 'static + Copy + Debug + Eq + Hash,
TOperator: Deserialize<'de>,
[src]
TOperator: 'static + Copy + Debug + Eq + Hash,
TOperator: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<TOperator> Serialize for PeepholeOptimizations<TOperator> where
TOperator: 'static + Copy + Debug + Eq + Hash,
TOperator: Serialize,
[src]
TOperator: 'static + Copy + Debug + Eq + Hash,
TOperator: Serialize,
Auto Trait Implementations
impl<TOperator> RefUnwindSafe for PeepholeOptimizations<TOperator> where
TOperator: RefUnwindSafe,
[src]
TOperator: RefUnwindSafe,
impl<TOperator> Send for PeepholeOptimizations<TOperator> where
TOperator: Send,
[src]
TOperator: Send,
impl<TOperator> Sync for PeepholeOptimizations<TOperator> where
TOperator: Sync,
[src]
TOperator: Sync,
impl<TOperator> Unpin for PeepholeOptimizations<TOperator>
[src]
impl<TOperator> UnwindSafe for PeepholeOptimizations<TOperator> where
TOperator: RefUnwindSafe,
[src]
TOperator: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,