Insert explicit RC instructions. So, it assumes the input code does not contain inc
nor dec
instructions.
This transformation is applied before lower level optimizations
that introduce the instructions release
and set
Instances For
Equations
- Lean.IR.ExplicitRC.instInhabitedVarInfo = { default := { ref := default, persistent := default, consume := default } }
@[reducible, inline]
Equations
- Lean.IR.ExplicitRC.VarMap = Lean.RBMap Lean.IR.VarId Lean.IR.ExplicitRC.VarInfo fun (x y : Lean.IR.VarId) => compare x.idx y.idx
- env : Environment
- varMap : VarMap
- jpLiveVarMap : JPLiveVarMap
- localCtx : LocalContext
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.IR.ExplicitRC.getJPLiveVars ctx j = match Lean.RBMap.find? ctx.jpLiveVarMap j with | some s => s | none => ∅
Equations
- Lean.IR.ExplicitRC.mustConsume ctx x = ((Lean.IR.ExplicitRC.getVarInfo ctx x).ref && (Lean.IR.ExplicitRC.getVarInfo ctx x).consume)
@[inline]
Equations
- Lean.IR.ExplicitRC.addInc ctx x b n = if (n == 0) = true then b else Lean.IR.FnBody.inc x n true (Lean.IR.ExplicitRC.getVarInfo ctx x).persistent b
@[inline]
Equations
- Lean.IR.ExplicitRC.addDec ctx x b = Lean.IR.FnBody.dec x 1 true (Lean.IR.ExplicitRC.getVarInfo ctx x).persistent b
Equations
- One or more equations did not get rendered due to their size.
- Lean.IR.ExplicitRC.visitDecl env decls d = d
Equations
- Lean.IR.explicitRC decls = do let env ← Lean.IR.getEnv pure (Array.map (Lean.IR.ExplicitRC.visitDecl env decls) decls)