-
Notifications
You must be signed in to change notification settings - Fork 248
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
fix(performance): Remove redundant slice access check from brillig #7434
Merged
Conversation
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
Changes to Brillig bytecode sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Changes to number of Brillig opcodes executed
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
TomAFrench
approved these changes
Feb 18, 2025
|
TomAFrench
added a commit
that referenced
this pull request
Feb 19, 2025
* master: fix(performance): Remove redundant slice access check from brillig (#7434) chore(docs): updating tutorials and other nits to beta.2 (#7405) feat: LSP hover for integer literals (#7368) feat(experimental): Compile match expressions (#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (#7258) feat: allow unquoting TraitConstraint in trait impl position (#7395) feat(brillig): Hoist shared constants across functions to the global space (#7216) feat(LSP): auto-import via visible reexport (#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (#7277) chore: redo typo PR by maximevtush (#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (#7396) feat!: remove bigint from stdlib (#7411)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 19, 2025
…m brillig (noir-lang/noir#7434) chore(docs): updating tutorials and other nits to beta.2 (noir-lang/noir#7405) feat: LSP hover for integer literals (noir-lang/noir#7368) feat(experimental): Compile match expressions (noir-lang/noir#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (noir-lang/noir#7258) feat: allow unquoting TraitConstraint in trait impl position (noir-lang/noir#7395) feat(brillig): Hoist shared constants across functions to the global space (noir-lang/noir#7216) feat(LSP): auto-import via visible reexport (noir-lang/noir#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (noir-lang/noir#7277) chore: redo typo PR by maximevtush (noir-lang/noir#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (noir-lang/noir#7396) feat!: remove bigint from stdlib (noir-lang/noir#7411) chore: bump aztec-packages commit (noir-lang/noir#7415) chore: deprecate `merkle` module of stdlib (noir-lang/noir#7413) chore(ci): lock aztec-packages commit in CI (noir-lang/noir#7414) feat: while statement (noir-lang/noir#7280)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 19, 2025
…oir-lang/noir#7434) chore(docs): updating tutorials and other nits to beta.2 (noir-lang/noir#7405) feat: LSP hover for integer literals (noir-lang/noir#7368) feat(experimental): Compile match expressions (noir-lang/noir#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (noir-lang/noir#7258) feat: allow unquoting TraitConstraint in trait impl position (noir-lang/noir#7395) feat(brillig): Hoist shared constants across functions to the global space (noir-lang/noir#7216) feat(LSP): auto-import via visible reexport (noir-lang/noir#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (noir-lang/noir#7277) chore: redo typo PR by maximevtush (noir-lang/noir#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (noir-lang/noir#7396) feat!: remove bigint from stdlib (noir-lang/noir#7411) chore: bump aztec-packages commit (noir-lang/noir#7415) chore: deprecate `merkle` module of stdlib (noir-lang/noir#7413) chore(ci): lock aztec-packages commit in CI (noir-lang/noir#7414) feat: while statement (noir-lang/noir#7280)
TomAFrench
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 19, 2025
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix(performance): Remove redundant slice access check from brillig (noir-lang/noir#7434) chore(docs): updating tutorials and other nits to beta.2 (noir-lang/noir#7405) feat: LSP hover for integer literals (noir-lang/noir#7368) feat(experimental): Compile match expressions (noir-lang/noir#7312) feat(acir_field): Add little-endian byte serialization for FieldElement (noir-lang/noir#7258) feat: allow unquoting TraitConstraint in trait impl position (noir-lang/noir#7395) feat(brillig): Hoist shared constants across functions to the global space (noir-lang/noir#7216) feat(LSP): auto-import via visible reexport (noir-lang/noir#7409) fix(brillig): Brillig entry point analysis and function specialization through duplication (noir-lang/noir#7277) chore: redo typo PR by maximevtush (noir-lang/noir#7425) fix(ssa): Accurately mark binary ops for hoisting and check Div/Mod against induction variable lower bound (noir-lang/noir#7396) feat!: remove bigint from stdlib (noir-lang/noir#7411) chore: bump aztec-packages commit (noir-lang/noir#7415) chore: deprecate `merkle` module of stdlib (noir-lang/noir#7413) chore(ci): lock aztec-packages commit in CI (noir-lang/noir#7414) feat: while statement (noir-lang/noir#7280) END_COMMIT_OVERRIDE --------- Co-authored-by: Tom French <tom@tomfren.ch>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Problem*
No issue, small optimization I found while exploring other Brillig gen optimizations.
Summary*
For every slice access, we code gen a slice access check against its dynamic index:
noir/compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs
Line 475 in 988adae
In Brillig gen we use
!dfg.is_safe_index
to determine whether to code gen an array index. This always returns false for slice types as we cannot check against their length. However, we already have generated a check the precedes the array access. We should generate this validation code for array types in Brillig gen.Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.