-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssa): Use post order when mapping instructions in loop invariant …
…pass (#7140) Co-authored-by: Tom French <[email protected]>
- Loading branch information
1 parent
f73dc9a
commit b00facb
Showing
7 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "regression_7128" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
in0 = "1" |
26 changes: 26 additions & 0 deletions
26
test_programs/execution_failure/regression_7128/src/main.nr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
fn main(in0: Field) -> pub Field { | ||
let mut out0: Field = 0; | ||
let tmp1: Field = in0; | ||
|
||
if (out0 == out0) // <== changing out0 to in0 or removing | ||
{ | ||
// the comparison changes the result | ||
let in0_as_bytes: [u8; 32] = in0.to_be_bytes(); | ||
let mut result: [u8; 32] = [0; 32]; | ||
for i in 0..32 { | ||
result[i] = in0_as_bytes[i]; | ||
} | ||
} | ||
|
||
let mut tmp2: Field = 0; // <== moving this to the top of main, | ||
if (0.lt(in0)) // changes the result | ||
{ | ||
tmp2 = 1; | ||
} | ||
|
||
out0 = (tmp2 - tmp1); | ||
|
||
assert(out0 != 0, "soundness violation"); | ||
|
||
out0 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "regression_7128" | ||
type = "bin" | ||
authors = [""] | ||
|
||
[dependencies] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
in0 = "1" |
26 changes: 26 additions & 0 deletions
26
test_programs/execution_success/regression_7128/src/main.nr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
fn main(in0: Field) -> pub Field { | ||
let mut out0: Field = 0; | ||
let tmp1: Field = in0; | ||
|
||
if (out0 == out0) // <== changing out0 to in0 or removing | ||
{ | ||
// the comparison changes the result | ||
let in0_as_bytes: [u8; 32] = in0.to_be_bytes(); | ||
let mut result: [u8; 32] = [0; 32]; | ||
for i in 0..32 { | ||
result[i] = in0_as_bytes[i]; | ||
} | ||
} | ||
|
||
let mut tmp2: Field = 0; // <== moving this to the top of main, | ||
if (0.lt(in0)) // changes the result | ||
{ | ||
tmp2 = 1; | ||
} | ||
|
||
out0 = (tmp2 - tmp1); | ||
|
||
assert(out0 == 0, "completeness violation"); | ||
|
||
out0 | ||
} |
b00facb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.20
.regression_4709
0.002
s0.001
s2
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench