-
Notifications
You must be signed in to change notification settings - Fork 219
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
Failed determining slice length at compile time without any runtime conditionals #4736
Comments
Yeah, this is the issue. In order for the compiler to know that The obvious solution is that we iteratively unroll loops, performing these later passes to propagate knowledge necessary for later loops but this doesn't seem like a trivial fix. |
# Description ## Problem\* Resolves #4736 ## Summary\* Instead of trying to unroll loops once, adds a meta pass that tries to unroll as many times as necessary, simplifying and doing mem2reg between unrolls. - For the cases where the program unrolls succesfully at the first try, no compile time overhead is created - For the cases where the program does contain an unknown at compile time loop bound, it'll try one more time before failing, since the stop condition is that "this unroll retry generated the same amount of errors as the previous one" - For the cases where the program doesn't contain an unknown at compile time loop bound, instead of failing it'll do as many unrolls as necessary to unroll the loop. ## 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: jfecher <jake@aztecprotocol.com>
After noir-lang/noir#4736 was fixed, now this is possible :) --------- Co-authored-by: Alvaro Rodriguez <sirasistant@MacBook-Pro-de-Alvaro.local>
After noir-lang/noir#4736 was fixed, now this is possible :) --------- Co-authored-by: Alvaro Rodriguez <sirasistant@MacBook-Pro-de-Alvaro.local>
After noir-lang/noir#4736 was fixed, now this is possible :) --------- Co-authored-by: Alvaro Rodriguez <sirasistant@MacBook-Pro-de-Alvaro.local>
Aim
Compile code like this one:
Expected Behavior
Should figure out that the length of serialized_points is 6 and compile succesfully
Bug
Seems like the length is known at the end of the optimization pipeline, since it figures it out if we just return it
It indeed finds out that the length is 6
To Reproduce
Project Impact
Nice-to-have
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
None
Nargo Version
No response
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: