nightly-2024-04-07: feat: add `remove_enable_side_effects` SSA pass (#4224)
Pre-release
Pre-release
·
1348 commits
to master
since this release
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* The `EnableSideEffects` instruction can hamper dead instruction elimination in the case where it's not covering any instructions which have side effects (and so are affected by the `EnableSideEffects` instruction). In this case we cannot perform any DIE on instructions used to calculate the predicate as the compiler sees their results as being used. This PR adds a new SSA pass which delays inserting `EnableSideEffects` instructions until the next instruction which would be affected by them. This means that if we hit another `EnableSideEffects` instruction first then we can omit the previous one, unlocking more DIE opportunities. ## Additional Context ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** 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. --------- Co-authored-by: jfecher <[email protected]>