[][src]Enum souper_ir::ast::Replacement

pub enum Replacement {
    LhsRhs {
        statements: Arena<Statement>,
        lhs: Infer,
        rhs: Operand,
    },
    Cand {
        statements: Arena<Statement>,
        cand: Cand,
    },
}

A complete optimization that replaces a left-hand side with a right-hand side.

Variants

LhsRhs

A replacement in the form of a left-hand side followed by a right-hand side.

Fields of LhsRhs

statements: Arena<Statement>

Statements that make up the expression DAGs for the left- and right-hand sides.

lhs: Infer

The left-hand side that is matched by the optimization.

rhs: Operand

The right-hand side that replaces the left-hand side after applying the optimization.

Cand

A replacement in the form of an expression DAG followed by a cand x y statement that declares that y is a candidate for replacing x.

Fields of Cand

statements: Arena<Statement>

Statements that make up the expression DAG for both the replacement's left- and right-hand sides.

cand: Cand

The candidate rewrite connecting the left- and right-hand sides of this replacement within statements.

Implementations

impl Replacement[src]

pub fn assignment(&self, id: ValueId) -> &Assignment[src]

Get the assignment that defined the given value.

Panics

May panic or produce incorrect results if given a ValueId from another Replacement, LeftHandSide, or RightHandSide's arena.

Trait Implementations

impl Clone for Replacement[src]

impl Debug for Replacement[src]

impl Display for Replacement[src]

impl Parse for Replacement[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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.