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: usizeNumber of additional equalities derived from predicates.
Implementations§
Source§impl PredicateGVN
impl PredicateGVN
pub fn new() -> Self
Sourcepub fn enter_branch(&mut self, scrutinee: LcnfVarId, ctor_tag: u32)
pub fn enter_branch(&mut self, scrutinee: LcnfVarId, ctor_tag: u32)
Enter a case branch where scrutinee has constructor tag ctor_tag.
Sourcepub fn exit_branch(&mut self)
pub fn exit_branch(&mut self)
Exit the current branch, restoring the predicate environment.
Sourcepub fn knows_eq_lit(&self, var: LcnfVarId, lit: &LcnfLit) -> bool
pub fn knows_eq_lit(&self, var: LcnfVarId, lit: &LcnfLit) -> bool
Check if var == lit is known from active predicates.
Sourcepub fn run(&mut self, decl: &mut LcnfFunDecl, base_pass: &mut GVNPass)
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
impl Debug for PredicateGVN
Source§impl Default for PredicateGVN
impl Default for PredicateGVN
Source§fn default() -> PredicateGVN
fn default() -> PredicateGVN
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PredicateGVN
impl RefUnwindSafe for PredicateGVN
impl Send for PredicateGVN
impl Sync for PredicateGVN
impl Unpin for PredicateGVN
impl UnsafeUnpin for PredicateGVN
impl UnwindSafe for PredicateGVN
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more