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

Optimize Sub operations based upon the loop induction variable #7353

Closed
vezenovm opened this issue Feb 12, 2025 · 0 comments · Fixed by #7356
Closed

Optimize Sub operations based upon the loop induction variable #7353

vezenovm opened this issue Feb 12, 2025 · 0 comments · Fixed by #7356
Assignees
Labels
brillig Unconstrained functions / brillig IR enhancement New feature or request ssa

Comments

@vezenovm
Copy link
Contributor

Problem

In #6910 we started hoisting add/mul operations based upon the outer loop's induction variable. While in #7344 we are adding further optimizations to transform checked operations to unchecked based upon the induction variable.

For simplicity in those initial PRs, sub operations were not included in the above optimizations. Sub overflows depend on if the induction variable is on the lhs or the rhs (e.g. if it is the rhs we should check the induction variable's upper bound but if it is the lhs we should check the lower bound).

Happy Case

Sub operations that do not overflow when using a given induction variable should be optimized either through hoisting or being transformed to an unchecked operation.

Workaround

None

Workaround Description

The compiler needs to add this optimization for it to be applied.

Additional Context

No response

Project Impact

Blocker

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@vezenovm vezenovm added brillig Unconstrained functions / brillig IR enhancement New feature or request ssa labels Feb 12, 2025
@vezenovm vezenovm self-assigned this Feb 12, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 12, 2025
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brillig Unconstrained functions / brillig IR enhancement New feature or request ssa
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant