From cbee4c0ad3606b2607fb4fdc88d1caa90a7c3462 Mon Sep 17 00:00:00 2001 From: jfecher Date: Wed, 14 Jun 2023 05:34:17 -0500 Subject: [PATCH] fix(ssa refactor): Do not remove enable_side_effects instructions in die pass (#1673) Do not remove enable_side_effects instructions in die pass --- crates/noirc_evaluator/src/ssa_refactor/opt/die.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/noirc_evaluator/src/ssa_refactor/opt/die.rs b/crates/noirc_evaluator/src/ssa_refactor/opt/die.rs index 62add9a73de..ef73938cc37 100644 --- a/crates/noirc_evaluator/src/ssa_refactor/opt/die.rs +++ b/crates/noirc_evaluator/src/ssa_refactor/opt/die.rs @@ -93,7 +93,10 @@ impl Context { let instruction = &function.dfg[instruction_id]; // These instruction types cannot be removed - if matches!(instruction, Constrain(_) | Call { .. } | Store { .. }) { + if matches!( + instruction, + Constrain(_) | Call { .. } | Store { .. } | EnableSideEffects { .. } + ) { return false; }