Skip to content

Cranelift: add/modify mid-end opt rules - #14296

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
myunbin:add-rules-260908
Sep 8, 2026
Merged

Cranelift: add/modify mid-end opt rules#14296
cfallin merged 1 commit into
bytecodealliance:mainfrom
myunbin:add-rules-260908

Conversation

@myunbin

@myunbin myunbin commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Add new opt rules:

  • x /u (1 << y) ==> x >>u y
  • (x ^ y) ^ (x ^ z) ==> y ^ z
  • (-x) & 1 ==> x & 1
  • (x >>s y) >s -1 ==> x >=s 0
  • (x >>s y) >=s 0 ==> x >=s 0
  • (x & y) & (x | z) ==> x & y
  • (x & y) | (x | z) ==> x | z
  • (x & y) | (x ^ y) ==> x | y
  • ~((~x) - y) ==> x + y
  • rotl(x, k) == rotl(y, k) ==> x == y
  • ~((~x) >>s y) ==> x >>s y

Apply all_zero helper to existing zero-constant rules in:

{arithmetic, bitops, cprop, extends, icmp, selects, shifts}.isle

@myunbin
myunbin requested a review from a team as a code owner September 8, 2026 05:55
@myunbin
myunbin requested review from cfallin and removed request for a team September 8, 2026 05:55
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Subscribe to Label Action

cc @avanhatt, @cfallin, @fitzgen, @mmcloughlin

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

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

  • avanhatt: isle
  • cfallin: isle
  • fitzgen: isle
  • mmcloughlin: isle

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

Learn more.

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@cfallin
cfallin added this pull request to the merge queue Sep 8, 2026
Merged via the queue into bytecodealliance:main with commit b8e5e03 Sep 8, 2026
81 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