Skip to main content

optimize_program

Function optimize_program 

Source
pub fn optimize_program<'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

The AOT optimizer — ONE pipeline. The Futamura residual (fold, propagate, polyvariant PE, CTFE) then the ARCHITECT: equality saturation over a kernel-certified e-graph, Oracle facts gating the conditional rewrites (value facts suppressed for loop-mutated variables — see egraph::convert); then defunctionalization, deforestation, interval analysis, DCE, and supercompilation. GVN/LICM/closed-form STILL run after the e-graph until it subsumes their cross-statement and loop-recurrence reach (the EG waves).