Skip to content

nightly-2024-05-06: fix: Move remove_if_else pass after second inlining (#4976)

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 06 May 02:15
· 63 commits to master since this release
96fb3e9
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

For the test added in this PR I bumped the `max_iter` in
`try_merge_only_changed_indices`. We then get the following panic:
```
The application panicked (crashed).
Message:  internal error: entered unreachable code: All Value::Instructions should already be known during inlining after creating the original inlined instruction. Unknown value v41 = Instruction { instruction: Id(76), position: 0, typ: Array([Numeric(Unsigned { bit_size: 32 })], 30) }
Location: compiler/noirc_evaluator/src/ssa/opt/inlining.rs:253
``` 
We have to inline immediately following mem2reg before extra
instructions are added by the remove_if_else pass.

## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.