Skip to content

Conversation

@afonso360
Copy link
Contributor

@afonso360 afonso360 commented Aug 22, 2023

👋 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)

@afonso360 afonso360 requested a review from a team as a code owner August 22, 2023 11:27
@afonso360 afonso360 requested review from fitzgen and removed request for a team August 22, 2023 11:27
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Aug 22, 2023
@github-actions
Copy link

Subscribe to Label Action

cc @cfallin, @fitzgen

Details This issue or pull request has been labeled: "cranelift", "isle"

Thus the following users have been cc'd because of the following labels:

  • cfallin: isle
  • fitzgen: isle

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

Copy link
Member

@fitzgen fitzgen left a 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.

@afonso360
Copy link
Contributor Author

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.

@afonso360
Copy link
Contributor Author

I've restricted this transform for vectors only since each backend implements a different subset of bitselect. Maybe we can derestrict this a little bit more once the backends are slightly more complete.

Copy link
Contributor

@jameysharp jameysharp left a 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!

@afonso360 afonso360 added this pull request to the merge queue Aug 29, 2023
Merged via the queue into bytecodealliance:main with commit 16aa064 Aug 29, 2023
@afonso360 afonso360 deleted the opt-bitselect branch August 29, 2023 20:36
eduardomourar pushed a commit to eduardomourar/wasmtime that referenced this pull request Sep 6, 2023
…nce#6879)

* egraphs: Transform bitops into a `bitselect`

* cranelift: Add bitwise bitselect tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants