-
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): Handle array set optimization across blocks for Brillig f…
…unctions (#6153) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> Part of general effort to reduce Brillig bytecode sizes ## Summary\* We now go through all blocks of Brillig functions to determine whether we can mutate an array directly rather than copy it. We are still pretty conservative with our checks to make sure that we do not inadvertently mark the wrong array set mutable. - If we have seen a last array set whose array comes from a Load result we do not make that array set mutable unless we are in a return block. We can expand upon the cases in which we mark an array loaded from a reference as mutable in follow-ups. - If the array is used in the terminator of a block we do not mark its array set mutable. ## 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
103b54d
commit 12cb80a
Showing
1 changed file
with
179 additions
and
19 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