diff --git a/compiler/noirc_evaluator/src/ssa.rs b/compiler/noirc_evaluator/src/ssa.rs index 2500b8685a..4f0a5b7284 100644 --- a/compiler/noirc_evaluator/src/ssa.rs +++ b/compiler/noirc_evaluator/src/ssa.rs @@ -171,7 +171,7 @@ fn optimize_all(builder: SsaBuilder, options: &SsaEvaluatorOptions) -> Result true, + // Cast instructions can always be deduplicated + Cast(_, _) => true, + // Arrays can be mutated in unconstrained code so code that handles this case must // take care to track whether the array was possibly mutated or not before // deduplicating. Since we don't know if the containing pass checks for this, we @@ -484,7 +487,6 @@ impl Instruction { // with one that was disabled. See // https://github.com/noir-lang/noir/pull/4716#issuecomment-2047846328. Binary(_) - | Cast(_, _) | Not(_) | Truncate { .. } | IfElse { .. }