Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
guipublic committed Dec 6, 2024
1 parent c33e627 commit c0eb24d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions compiler/noirc_evaluator/src/ssa/ir/instruction/call/blackbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,15 @@ pub(super) fn simplify_msm(
dfg.get_numeric_constant(points[3 * i + 1]),
dfg.get_numeric_constant(points[3 * i + 2]),
) {
(Some(lo), Some(hi), _, _, _)
if lo == FieldElement::zero() && hi == FieldElement::zero() =>
{
(Some(lo), Some(hi), _, _, _) if lo.is_zero() && hi.is_zero() => {
is_constant = true;
constant_scalars_lo.push(lo);
constant_scalars_hi.push(hi);
constant_points.push(FieldElement::zero());
constant_points.push(FieldElement::zero());
constant_points.push(FieldElement::one());
}
(_, _, _, _, Some(infinity)) if infinity == FieldElement::one() => {
(_, _, _, _, Some(infinity)) if infinity.is_one() => {
is_constant = true;
constant_scalars_lo.push(FieldElement::zero());
constant_scalars_hi.push(FieldElement::zero());
Expand Down Expand Up @@ -165,9 +163,9 @@ pub(super) fn simplify_msm(
return SimplifyResult::None;
}
// Add the constant part back to the non-constant part, if it is not null
if result_is_infinity != FieldElement::one() {
let one = dfg.make_constant(FieldElement::one(), Type::field());
let zero = dfg.make_constant(FieldElement::zero(), Type::field());
let one = dfg.make_constant(FieldElement::one(), Type::field());
let zero = dfg.make_constant(FieldElement::zero(), Type::field());
if result_is_infinity.is_zero() {
var_scalars.push(one);
var_scalars.push(zero);
let result_x = dfg.make_constant(result_x, Type::field());
Expand Down

0 comments on commit c0eb24d

Please sign in to comment.