Skip to content

Commit

Permalink
feat: skip remove_enable_side_effects pass on brillig functions (#6199
Browse files Browse the repository at this point in the history
)

# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

PR described in comment in code.

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
TomAFrench authored Oct 2, 2024
1 parent 6440e18 commit 2303615
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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());

Expand Down

0 comments on commit 2303615

Please sign in to comment.