diff --git a/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs b/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs index c611ab682bf..daae2cb08ce 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs @@ -16,7 +16,7 @@ use crate::ssa::{ ir::{ basic_block::BasicBlockId, dfg::DataFlowGraph, - function::Function, + function::{Function, RuntimeType}, instruction::{BinaryOp, Instruction, Intrinsic}, types::Type, value::Value, @@ -37,6 +37,11 @@ impl Ssa { impl Function { pub(crate) fn remove_enable_side_effects(&mut self) { + if matches!(self.runtime(), RuntimeType::Brillig) { + // Brillig functions do not make use of the `EnableSideEffects` instruction so are unaffected by this pass. + return; + } + let mut context = Context::default(); context.block_queue.push(self.entry_block());