Skip to content

[Cranelift] add simplification rules#12937

Merged
fitzgen merged 1 commit intobytecodealliance:mainfrom
myunbin:add-rules-040226
Apr 2, 2026
Merged

[Cranelift] add simplification rules#12937
fitzgen merged 1 commit intobytecodealliance:mainfrom
myunbin:add-rules-040226

Conversation

@myunbin
Copy link
Copy Markdown
Contributor

@myunbin myunbin commented Apr 2, 2026

This PR adds several simplification rules:

bitops.isle

  • (~x & y) ^ x --> x | y
  • (x | y) & ~(x ^ y) --> x & y
  • x | ~(x ^ y) --> x | ~y
  • x | ((~x) ^ y) --> x | ~y
  • x & ~(x ^ y) --> x & y
  • x & ((~x) ^ y) --> x & y
  • (x | y) | (x ^ y) --> (x | y)
  • (x ^ y) & (x ^ (y ^ z)) --> (x ^ y) & ~z
  • (~x & y) ^ z --> (x & y) ^ (z ^ y)
  • ~x - ~y --> y - x
  • (~x & y) | ~(x | y) --> ~x
  • (~x | y) & ~(x & y) --> ~x
  • (x & y) | ~(x | y) --> ~(x ^ y)
  • (~x | y) ^ (x ^ y) --> x | ~y

@myunbin myunbin requested a review from a team as a code owner April 2, 2026 02:21
@myunbin myunbin requested review from fitzgen and removed request for a team April 2, 2026 02:21
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

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
Copy Markdown
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.

Thanks!

@fitzgen fitzgen added this pull request to the merge queue Apr 2, 2026
Merged via the queue into bytecodealliance:main with commit 4d4e903 Apr 2, 2026
79 checks passed
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.

2 participants