Skip to main content

optimize_dce

Function optimize_dce 

Source
pub fn optimize_dce(
    module: &LcnfModule,
    config: &DceConfig,
) -> (LcnfModule, DceStats)
Expand description

Run the complete DCE + constant propagation pipeline on a module.

The optimizer runs the enabled passes in a fixed-point loop:

  1. Constant propagation
  2. Copy propagation
  3. Known case folding
  4. Dead let elimination
  5. Unreachable alt elimination

After the fixed point, dead function elimination is applied once (interprocedural).

Returns the optimized module and accumulated statistics.