Function transform_internal_once

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

Accepts an injected acir_opcode_positions to allow transformations to be applied directly after optimizations.

It first performs the ‘CSAT transformation’ in one pass, slicing wide expressions into intermediate variables. Then it performs eliminate_intermediate_variable() which (re-)combines intermediate variables used only twice. It concludes with a round of replace_redundant_ranges() which removes range checks made redundant by the previous pass.

Pre-Conditions:

  • General Optimizer must run before this pass