-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CIR] Add Case Op Kind Range #650
Conversation
03c3c37
to
5684911
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for improving this, one minor comment inline and I'll merge this.
FWIW, some cool small optimizations ideas to work in future PRs:
- Recognize ranges that all fallthrough to the same block and transform it to just one range (e.g. the testcase in
sw1
). - Recognize
anyof
s in which elements are monotonic and convert those to a range.
One way to implement this is to add a SwitchOp::fold
method, and add SwitchOp
to the list of patterns in MergeCleanups.cpp
.
Comments added, thanks for pointing out the future works! |
Make lowering result of case range smart. Resolve llvm#632
Make lowering result of case range smart. Resolve llvm#632
Make lowering result of case range smart. Resolve llvm#632
Make lowering result of case range smart. Resolve llvm#632
Make lowering result of case range smart. Resolve #632
Make lowering result of case range smart.
Resolve #632