Skip to main content

optimize_for_projection

Function optimize_for_projection 

Source
pub fn optimize_for_projection<'a>(
    stmts: Vec<Stmt<'a>>,
    expr_arena: &'a Arena<Expr<'a>>,
    stmt_arena: &'a Arena<Stmt<'a>>,
    interner: &mut Interner,
    cfg: &OptimizationConfig,
) -> Vec<Stmt<'a>>
Expand description

Lighter optimization for Futamura P1: fold + propagate + PE + CTFE. Skips DCE, abstract interpretation, supercompilation, and structural transforms (LICM, closed-form, deforestation) that eliminate branches or restructure control flow. The residual preserves the program’s original control-flow structure while still folding constants, propagating values, specializing functions, and evaluating CTFE.