Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(perf): Allow array set last uses optimization in return block of Brillig functions #6119

Merged
merged 3 commits into from
Sep 20, 2024

Conversation

vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Sep 20, 2024

Description

Problem*

Resolves

Part of general effort to reduce Brillig bytecode sizes.

Summary*

We currently only perform the array set last uses optimization on ACIR functions. This makes sense as the pass only looks at last uses in a single block. We can start to expand the last uses opt to encompass more than just ACIR functions and make it aware of the last array set of an array across blocks. This is a bit more complex though so this PR currently just attempts to look at the return block of Brillig functions and see the effects.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

github-actions bot commented Sep 20, 2024

Changes to Brillig bytecode sizes

Generated at commit: 8cba016811a6e443406540eb859b3a4ce05a4faa, compared to commit: 3ecd0e29441d27bc77c49993495209a70be0d86e

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
brillig_array_to_slice -24 ✅ -24.00%
array_dynamic_main_output -24 ✅ -29.63%

Full diff report 👇
Program Brillig opcodes (+/-) %
fold_numeric_generic_poseidon 704 (-3) -0.42%
no_predicates_numeric_generic_poseidon 704 (-3) -0.42%
databus_two_calldata 252 (-3) -1.18%
reference_only_used_as_alias 216 (-33) -13.25%
nested_dyn_array_regression_5782 142 (-24) -14.46%
brillig_array_to_slice 76 (-24) -24.00%
array_dynamic_main_output 57 (-24) -29.63%

@vezenovm vezenovm marked this pull request as draft September 20, 2024 19:09
@vezenovm vezenovm marked this pull request as ready for review September 20, 2024 19:43
@vezenovm vezenovm requested review from a team and sirasistant September 20, 2024 19:45
@vezenovm vezenovm added this pull request to the merge queue Sep 20, 2024
Merged via the queue into master with commit 5598059 Sep 20, 2024
46 checks passed
@vezenovm vezenovm deleted the mv/array-set-opt-brillig-return branch September 20, 2024 20:10
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Sep 21, 2024
…urn block of Brillig functions (noir-lang/noir#6119)

feat: represent assertions more similarly to function calls (noir-lang/noir#6103)
feat: pretty print Quoted token stream (noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath` (noir-lang/noir#6117)
fix: disambiguate field or int static trait method call (noir-lang/noir#6112)
chore: delete duplicated test (noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }` (noir-lang/noir#6114)
chore: ec addition for non-zero points (noir-lang/noir#5858)
chore(docs): removing old versions (noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow (noir-lang/noir#6107)
fix: decode databus return values (noir-lang/noir#6095)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Sep 21, 2024
… Brillig functions (noir-lang/noir#6119)

feat: represent assertions more similarly to function calls (noir-lang/noir#6103)
feat: pretty print Quoted token stream (noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath` (noir-lang/noir#6117)
fix: disambiguate field or int static trait method call (noir-lang/noir#6112)
chore: delete duplicated test (noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }` (noir-lang/noir#6114)
chore: ec addition for non-zero points (noir-lang/noir#5858)
chore(docs): removing old versions (noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow (noir-lang/noir#6107)
fix: decode databus return values (noir-lang/noir#6095)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Sep 22, 2024
…urn block of Brillig functions (noir-lang/noir#6119)

feat: represent assertions more similarly to function calls (noir-lang/noir#6103)
feat: pretty print Quoted token stream (noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath` (noir-lang/noir#6117)
fix: disambiguate field or int static trait method call (noir-lang/noir#6112)
chore: delete duplicated test (noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }` (noir-lang/noir#6114)
chore: ec addition for non-zero points (noir-lang/noir#5858)
chore(docs): removing old versions (noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow (noir-lang/noir#6107)
fix: decode databus return values (noir-lang/noir#6095)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Sep 22, 2024
… Brillig functions (noir-lang/noir#6119)

feat: represent assertions more similarly to function calls (noir-lang/noir#6103)
feat: pretty print Quoted token stream (noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath` (noir-lang/noir#6117)
fix: disambiguate field or int static trait method call (noir-lang/noir#6112)
chore: delete duplicated test (noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }` (noir-lang/noir#6114)
chore: ec addition for non-zero points (noir-lang/noir#5858)
chore(docs): removing old versions (noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow (noir-lang/noir#6107)
fix: decode databus return values (noir-lang/noir#6095)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Sep 23, 2024
…urn block of Brillig functions (noir-lang/noir#6119)

feat: represent assertions more similarly to function calls (noir-lang/noir#6103)
feat: pretty print Quoted token stream (noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath` (noir-lang/noir#6117)
fix: disambiguate field or int static trait method call (noir-lang/noir#6112)
chore: delete duplicated test (noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }` (noir-lang/noir#6114)
chore: ec addition for non-zero points (noir-lang/noir#5858)
chore(docs): removing old versions (noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow (noir-lang/noir#6107)
fix: decode databus return values (noir-lang/noir#6095)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Sep 23, 2024
… Brillig functions (noir-lang/noir#6119)

feat: represent assertions more similarly to function calls (noir-lang/noir#6103)
feat: pretty print Quoted token stream (noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath` (noir-lang/noir#6117)
fix: disambiguate field or int static trait method call (noir-lang/noir#6112)
chore: delete duplicated test (noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }` (noir-lang/noir#6114)
chore: ec addition for non-zero points (noir-lang/noir#5858)
chore(docs): removing old versions (noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow (noir-lang/noir#6107)
fix: decode databus return values (noir-lang/noir#6095)
sirasistant added a commit to AztecProtocol/aztec-packages that referenced this pull request Sep 23, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat(perf): Allow array set last uses optimization in return block of
Brillig functions (noir-lang/noir#6119)
feat: represent assertions more similarly to function calls
(noir-lang/noir#6103)
feat: pretty print Quoted token stream
(noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath`
(noir-lang/noir#6117)
fix: disambiguate field or int static trait method call
(noir-lang/noir#6112)
chore: delete duplicated test
(noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }`
(noir-lang/noir#6114)
chore: ec addition for non-zero points
(noir-lang/noir#5858)
chore(docs): removing old versions
(noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow
(noir-lang/noir#6107)
fix: decode databus return values
(noir-lang/noir#6095)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <tom@tomfren.ch>
Co-authored-by: sirasistant <sirasistant@gmail.com>
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request Sep 24, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat(perf): Allow array set last uses optimization in return block of
Brillig functions (noir-lang/noir#6119)
feat: represent assertions more similarly to function calls
(noir-lang/noir#6103)
feat: pretty print Quoted token stream
(noir-lang/noir#6111)
feat: LSP autocompletion for `TypePath`
(noir-lang/noir#6117)
fix: disambiguate field or int static trait method call
(noir-lang/noir#6112)
chore: delete duplicated test
(noir-lang/noir#6113)
feat: (LSP) suggest $vars inside `quote { ... }`
(noir-lang/noir#6114)
chore: ec addition for non-zero points
(noir-lang/noir#5858)
chore(docs): removing old versions
(noir-lang/noir#6075)
fix(mem2reg): Remove possibility of underflow
(noir-lang/noir#6107)
fix: decode databus return values
(noir-lang/noir#6095)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <tom@tomfren.ch>
Co-authored-by: sirasistant <sirasistant@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants