-
Notifications
You must be signed in to change notification settings - Fork 666
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
[Bug] if ... else if
chain yields code of size quadratic in the number of conditions
#28386
Labels
bug
Something isn't working
Comments
mikebenfield
added a commit
that referenced
this issue
Oct 10, 2024
Specifically two changes are made: 1. Cache Anded together chains of conditionals for early returns. This prevents quadratic code being generated in the face of a chain of ifs like ``` if a { return 0u32; } else if b { return 1u32 } else if ... ``` 2. Take into account early returns for asserts. Fixes #28386, 28387
mikebenfield
added a commit
that referenced
this issue
Oct 10, 2024
Specifically two changes are made: 1. Cache Anded together chains of conditionals for early returns. This prevents quadratic code being generated in the face of a chain of ifs like ``` if a { return 0u32; } else if b { return 1u32 } else if ... ``` 2. Take into account early returns for asserts. Fixes #28386, #28387
mikebenfield
added a commit
that referenced
this issue
Oct 10, 2024
Specifically two changes are made: 1. Cache Anded together chains of conditionals for early returns. This prevents quadratic code being generated in the face of a chain of ifs like ``` if a { return 0u32; } else if b { return 1u32 } else if ... ``` 2. Take into account early returns for asserts. Fixes #28386, #28387
mikebenfield
added a commit
that referenced
this issue
Oct 10, 2024
Specifically two changes are made: 1. Cache Anded together chains of conditionals for early returns. This prevents quadratic code being generated in the face of a chain of ifs like ``` if a { return 0u32; } else if b { return 1u32 } else if ... ``` 2. Take into account early returns for asserts. Fixes #28386, #28387
mikebenfield
added a commit
that referenced
this issue
Oct 17, 2024
Specifically three changes are made: 1. Cache Anded together chains of conditionals for early returns. This prevents quadratic code being generated in the face of a chain of ifs like ``` if a { return 0u32; } else if b { return 1u32 } else if ... ``` 2. Take into account early returns for asserts, and cache the when reconstructing the assert, as with caching them for early returns. Fixes #28386, #28387
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
This Leo code:
Yields this aleo code:
The text was updated successfully, but these errors were encountered: