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
@[reducible, inline]
Equations
Instances For
- varMap : DerivedValMap
- borrowedParams : VarIdSet
Instances For
@[reducible, inline]
Equations
Instances For
@[reducible, inline]
Equations
- Lean.IR.ExplicitRC.VarMap = Std.TreeMap Lean.IR.VarId Lean.IR.ExplicitRC.VarInfo fun (x y : Lean.IR.VarId) => compare x.idx y.idx
Instances For
@[inline]
Equations
- liveVars1.merge liveVars2 = { vars := Std.TreeSet.merge liveVars1.vars liveVars2.vars, borrows := Std.TreeSet.merge liveVars1.borrows liveVars2.borrows }
Instances For
@[reducible, inline]
Equations
Instances For
- env : Environment
- borrowedParams : VarIdSet
- derivedValMap : DerivedValMap
- varMap : VarMap
- jpLiveVarMap : JPLiveVarMap
- localCtx : LocalContext
Instances For
Equations
- Lean.IR.ExplicitRC.getDecl ctx fid = (Lean.IR.findEnvDecl' ctx.env fid ctx.decls).get!
Instances For
Equations
- Lean.IR.ExplicitRC.getVarInfo ctx x = Std.TreeMap.get! ctx.varMap x
Instances For
Equations
- Lean.IR.ExplicitRC.getJPParams ctx j = (ctx.localCtx.getJPParams j).get!
Instances For
Equations
Instances For
@[inline]
Equations
- Lean.IR.ExplicitRC.addDec ctx x b = Lean.IR.FnBody.dec x 1 (!(Lean.IR.ExplicitRC.getVarInfo ctx x).isDefiniteRef) (Lean.IR.ExplicitRC.getVarInfo ctx x).persistent b
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.IR.ExplicitRC.visitDecl env decls d = d
Instances For
Equations
- Lean.IR.explicitRC decls = do let env ← Lean.getEnv pure (Array.map (Lean.IR.ExplicitRC.visitDecl env decls) decls)