Skip to content

Commit

Permalink
IncrementRC has no side effects?
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Nov 28, 2023
1 parent 7a08d1d commit fcc90db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/noirc_evaluator/src/ssa/ir/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,15 @@ impl Instruction {
| ArrayGet { .. }
| ArraySet { .. } => false,

// IncrementRc is not counted as having side effects since we still
// want it to be removed by the DIE pass if its parameter is unused.
// At the time of writing has_side_effects is only used by DIE but
// we should keep this in mind (or rename this method?) if it is ever used elsewhere.
IncrementRc { .. } => false,

Constrain(..)
| Store { .. }
| EnableSideEffects { .. }
| IncrementRc { .. }
| RangeCheck { .. } => true,

// Some `Intrinsic`s have side effects so we must check what kind of `Call` this is.
Expand Down

0 comments on commit fcc90db

Please sign in to comment.