acvm::compiler::optimizers

Function optimize_internal

Source
pub(super) fn optimize_internal<F: AcirField>(
    acir: Circuit<F>,
    acir_opcode_positions: Vec<usize>,
    brillig_side_effects: &BTreeMap<BrilligFunctionId, bool>,
) -> (Circuit<F>, Vec<usize>)
Expand description

Applies backend independent optimizations to a Circuit.

Accepts an injected acir_opcode_positions to allow optimizations to be applied in a loop. It run the following passes:

  • General optimizer
  • Unused Memory optimization
  • Redundant Ranges optimization