-
Notifications
You must be signed in to change notification settings - Fork 375
fix(ssa): Do not unroll loop with break #8090
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
Changes from all commits
c59c0e8
93d0aa0
1d47daa
1efa5de
fc606c6
4da8317
cb409eb
a7b912e
2f17c2c
f7677e3
cb24ed3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [package] | ||
| name = "loop_small_break" | ||
| type = "bin" | ||
| authors = [""] | ||
|
|
||
| [dependencies] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| x = 5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359) | ||
| // We want the loop to be small enough that the compiler may attempt to unroll it. | ||
| unconstrained fn main(x: Field) { | ||
| let mut count = 0; | ||
|
|
||
| for i in 0..1 { | ||
| if x == 5 { | ||
| count = i; | ||
| break; | ||
| } | ||
| } | ||
| assert(count == 0); | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.