pub fn simplify_branch_conditions(expr: &mut Expr) {
    use crate::ast::LiteralKind::BoolLiteral;
    expr.uniquify().unwrap();
    expr.transform_up(&mut |ref mut expr| {
        if let If {
            ref mut cond,
            ref mut on_true,
            ref mut on_false,
        } = expr.kind
        {
            let mut taken = None;
            if let BinOp {
                ref mut kind,
                ref mut left,
                ref mut right,
            } = cond.kind
            {
                if *kind == BinOpKind::Equal {
                    if let Literal(BoolLiteral(false)) = left.kind {
                        taken = Some(right.take());
                    } else if let Literal(BoolLiteral(false)) = right.kind {
                        taken = Some(left.take());
                    }
                }
            };

            if let Some(ref mut expr) = taken {
                mem::swap(cond, expr);
                mem::swap(on_true, on_false);
            }
        }
        // We just updated the expression in place instead of replacing it.
        None
    });
}
Simplifies branches with `<expr> == False` to just be over <expr>`

This switches the true condition and the false condition.
weld/src/optimizer/transforms/inliner.rs