pub fn inline_negate(expr: &mut Expr) {
    use crate::ast::LiteralKind::*;
    expr.transform(&mut |ref mut expr| {
        if let Negate(ref child_expr) = expr.kind {
            if let Literal(ref literal_kind) = child_expr.kind {
                let res = match *literal_kind {
                    I8Literal(a) => Some(Expr::new_literal(I8Literal(-a)).unwrap()),
                    I16Literal(a) => Some(Expr::new_literal(I16Literal(-a)).unwrap()),
                    I32Literal(a) => Some(Expr::new_literal(I32Literal(-a)).unwrap()),
                    I64Literal(a) => Some(Expr::new_literal(I64Literal(-a)).unwrap()),
                    F32Literal(a) => {
                        Some(Expr::new_literal(F32Literal((-f32::from_bits(a)).to_bits())).unwrap())
                    }
                    F64Literal(a) => {
                        Some(Expr::new_literal(F64Literal((-f64::from_bits(a)).to_bits())).unwrap())
                    }
                    _ => None,
                };
                return res;
            }
        }
        None
    });
}
Changes negations of literal values to be literal negated values.
weld/src/optimizer/transforms/inliner.rs