-
Notifications
You must be signed in to change notification settings - Fork 1.6k
egraphs: Recognize bitselect from bitwise operations
#6879
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
Conversation
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "cranelift", "isle"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
fitzgen
left a comment
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, but can we please add some runtests as well? Thanks!
A bit of an aside, but it also makes me think that we should make the runtest runner automatically run tests twice, once with optimizations and once without them. Because we want that for every single runtest that exercises any mid-end rewrite rule, and it definitely doesn't hurt for runtests that are just stressing lowering or something.
|
Looks like the x86 backend does not have scalar bitselect implemented. I'm going to try to work on that so that we don't an optimization that generates code that can't be lowered. |
f0b3594 to
72f3683
Compare
|
I've restricted this transform for vectors only since each backend implements a different subset of |
72f3683 to
3e9e43e
Compare
jameysharp
left a comment
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.
That's a good restriction to adopt for now and a good assortment of new tests. Thanks!
…nce#6879) * egraphs: Transform bitops into a `bitselect` * cranelift: Add bitwise bitselect tests
👋 Hey,
While working on #6876, I noticed we don't yet recognize this pattern for bitselects. I've also added the various permutations of this rule since I don't think we rotate inputs on bitwise operations. (And my understanding is that we shouldn't do so)