pub fn move_merge_before_let(expr: &mut Expr) {
    expr.transform_up(&mut |ref mut expr| {
        if let Let {
            ref name,
            value: ref let_value,
            ref body,
        } = expr.kind
        {
            if let Merge {
                ref builder,
                value: ref merge_value,
            } = body.kind
            {
                if !builder.contains_symbol(name) {
                    return Some(
                        Expr::new_merge(
                            *builder.clone(),
                            Expr::new_let(name.clone(), *let_value.clone(), *merge_value.clone())
                                .unwrap(),
                        )
                        .unwrap(),
                    );
                }
            }
        }
        None
    });
}
Replaces Let(name, value, Merge(builder, elem)) with Merge(builder, Let(name, value, elem)) to
enable further pattern matching on map functions downstream. This is only allowed when the let
statement is not defining some symbol that's used in the builder expression, so we check for that.
weld/src/optimizer/transforms/loop_fusion_2.rs