Common Sub-expression Elimination
- subst : Lean.Compiler.LCNF.FVarSubst
Instances For
@[inline, reducible]
Equations
Equations
- Lean.Compiler.LCNF.CSE.instMonadFVarSubstMFalse = { getSubst := do let __do_lift ← get pure __do_lift.subst }
Equations
- Lean.Compiler.LCNF.CSE.instMonadFVarSubstStateM = { modifySubst := fun f => modify fun s => { map := s.map, subst := f s.subst } }
@[inline]
Equations
- Lean.Compiler.LCNF.CSE.getSubst = do let __do_lift ← get pure __do_lift.subst
Instances For
@[inline]
Equations
- Lean.Compiler.LCNF.CSE.addEntry value fvarId = modify fun s => { map := Lean.PersistentHashMap.insert s.map value fvarId, subst := s.subst }
Instances For
@[inline]
Equations
- Lean.Compiler.LCNF.CSE.withNewScope x = do let __do_lift ← get let map : Lean.PHashMap Lean.Expr Lean.FVarId := __do_lift.map tryFinally x (modify fun s => { map := map, subst := s.subst })
Instances For
Equations
- Lean.Compiler.LCNF.CSE.replaceLet decl fvarId = do liftM (Lean.Compiler.LCNF.eraseLetDecl decl) Lean.Compiler.LCNF.addFVarSubst decl.fvarId fvarId
Instances For
Equations
- Lean.Compiler.LCNF.CSE.replaceFun decl fvarId = do liftM (Lean.Compiler.LCNF.eraseFunDecl decl true) Lean.Compiler.LCNF.addFVarSubst decl.fvarId fvarId
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Common sub-expression elimination
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Lean.Compiler.LCNF.cse
(phase : optParam Lean.Compiler.LCNF.Phase Lean.Compiler.LCNF.Phase.base)
(occurrence : optParam Nat 0)
:
Equations
- Lean.Compiler.LCNF.cse phase occurrence = Lean.Compiler.LCNF.Pass.mkPerDeclaration `cse Lean.Compiler.LCNF.Decl.cse phase occurrence