Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ssa): Simplify signed casts (#6166)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> Small optimization I noticed while working on other tasks. ## Summary\* We currently simplify when casting to a field or an unsigned type. We can also simplify when casting to a signed type. This is an initial version that is quite conservative in the simplification. If we we have a constant that is below `2^(bit_size-1)` when casting to a signed type we return the constant with the new signed type. I also added the case of signed -> field as this can be the same as going unsigned -> field. ## Additional Context ## Documentation\* Check one: - [X] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information