-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(perf): Remove inc_rc instructions for arrays which are never mut…
…ably borrowed (#6168) # Description ## Problem\* Part of general effort to reduce Brillig bytecode sizes ## Summary\* An array can be borrowed without being mutated. We code gen inc_rc instructions quite pessimistically on every borrow or reassignment of an array. If we know that the array is never mutated, it should be safe to remove these inc_rc instructions. During DIE we now track all inc_rc instructions in a block and if that array is never used in an array set or a store, we mark its inc_rc instruction for removal. ## 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. --------- Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
- Loading branch information
1 parent
d26d20f
commit a195442
Showing
1 changed file
with
187 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters