-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove copy propagation from the native/WASM and Rust pipelines (#2846)
* Closes #2845 * Copy propagation is not correct without subsequent adjusting of live variables. See the comments in #2845. * Enables JuvixReg transformations in the test suite, which exposes the bug. * Adds a test in JuvixAsm crafted specifically to expose this bug.
- Loading branch information
Showing
5 changed files
with
53 additions
and
6 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
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 @@ | ||
11 |
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,42 @@ | ||
-- Copy propagation | ||
|
||
-- This test will fail with the native/WASM backend if copy propagation is | ||
-- performed on JuvixReg without adjusting the live variables. | ||
|
||
function f(integer) { | ||
push arg[0]; | ||
push 0; | ||
eq; | ||
br { | ||
true: { | ||
push 3; | ||
push 4; | ||
tsave { | ||
tsave { | ||
push tmp[1]; | ||
call f; | ||
push tmp[0]; | ||
add; | ||
ret; | ||
}; | ||
}; | ||
}; | ||
false: { | ||
push arg[0]; | ||
push arg[0]; | ||
push arg[0]; | ||
push arg[0]; | ||
add; | ||
sub; | ||
add; | ||
push 1; | ||
add; | ||
ret; | ||
}; | ||
}; | ||
} | ||
|
||
function main() { | ||
push 0; | ||
tcall f; | ||
} |