You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During preprocessing functions we wanted to call the DIE pass on them to remove leftover instructions after doing mem2reg, but in one example described in the PR description it eliminated the entire function body, causing execution to fail.
Expected Behavior
Adding the DIE pass to the preprocessing of functions should not cause integration test failures.
aakoshh
changed the title
Dead Instruction Elimination doesn't consider mutable reference input parameters
Dead Instruction Elimination doesn't consider &mut parameters
Jan 17, 2025
Aim
Discovered in #7072
During preprocessing functions we wanted to call the DIE pass on them to remove leftover instructions after doing mem2reg, but in one example described in the PR description it eliminated the entire function body, causing execution to fail.
Expected Behavior
Adding the DIE pass to the preprocessing of functions should not cause integration test failures.
Maxim said:
Bug
Here's the SSA before and after the preprocessing pass, when the DIE was called on every function:
Before:
After:
It saw
store v4 at v0
as a dead instruction, not realising thatv0
can be used by the caller.To Reproduce
Workaround
None
Workaround Description
The DIE pass has been commented out from
preprocess_fns
.Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
nargo version = 1.0.0-beta.1 noirc version = 1.0.0-beta.1+4e3ea96602c9d9e70c96e19c56ee7c1290d8f12f (git version hash: 4e3ea96, is dirty: false)
NoirJS Version
No response
Proving Backend Tooling & 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: