Skip to main content

PredicateGVN

Struct PredicateGVN 

Source
pub struct PredicateGVN {
    pub equalities_derived: usize,
    /* private fields */
}
Expand description

GVN pass that uses branch predicates to derive additional equalities.

When we enter a case branch where the scrutinee matches tag t, we know the scrutinee is a specific constructor. This lets us refine value numbers for projection expressions.

Fields§

§equalities_derived: usize

Number of additional equalities derived from predicates.

Implementations§

Source§

impl PredicateGVN

Source

pub fn new() -> Self

Source

pub fn enter_branch(&mut self, scrutinee: LcnfVarId, ctor_tag: u32)

Enter a case branch where scrutinee has constructor tag ctor_tag.

Source

pub fn exit_branch(&mut self)

Exit the current branch, restoring the predicate environment.

Source

pub fn knows_eq_lit(&self, var: LcnfVarId, lit: &LcnfLit) -> bool

Check if var == lit is known from active predicates.

Source

pub fn run(&mut self, decl: &mut LcnfFunDecl, base_pass: &mut GVNPass)

Run predicate-based GVN on decl, augmenting an existing GVNPass.

Trait Implementations§

Source§

impl Debug for PredicateGVN

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PredicateGVN

Source§

fn default() -> PredicateGVN

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.