plutus-core-1.65.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusIR.Transform.RecInline

Description

Mutual recursion inlining.

Given a let rec group, this pass identifies helper bindings — those not used by the body (non-roots), not self-recursive, and safe to inline according to the same size/cost heuristics as the main inliner — and inlines them into their callers. This works across independent subgroups within the same let rec, e.g. {even, odd, f, g} where {even, odd} and {f, g} are separate cycles.

No beta reduction is performed here; the resulting applications are left for downstream passes to clean up.

Synopsis

Documentation

recInline ∷ (ToBuiltinMeaning uni fun, MonadQuote m) ⇒ BuiltinsInfo uni fun → BoolTerm TyName Name uni fun a → m (Term TyName Name uni fun a) Source #

Walk the term bottom-up, attempting to collapse each let rec group.

recInlinePass ∷ (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ BuiltinsInfo uni fun → BoolPirTCConfig uni fun → Pass m TyName Name uni fun a Source #

recInlinePassSC ∷ (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ BuiltinsInfo uni fun → BoolPirTCConfig uni fun → Pass m TyName Name uni fun a Source #