Skip to content

Cranelift: add mid-end optimization rules - #14201

Merged
fitzgen merged 5 commits into
bytecodealliance:mainfrom
bongjunj:bongjun/new-rules
Aug 25, 2026
Merged

Cranelift: add mid-end optimization rules#14201
fitzgen merged 5 commits into
bytecodealliance:mainfrom
bongjunj:bongjun/new-rules

Conversation

@bongjunj

@bongjunj bongjunj commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Hi, I added some missing optimization rules:

  • x - (-y << z) = x + (y << z)
  • (x << y) | (z << y) = (x | z) << y
  • (x & y) & (x & z) --> (x & y) & z
  • and one commutative variant of an existing rule

Also added unit test cases for these rules, and blessed minor changes of tests.

Thank you.


Besides this PR, I noticed that the new ISLE verifier was integrated.
Do you have any plan to run the verifier for all existing midend/backend rules on a regular basis (like CI)?

@bongjunj
bongjunj requested a review from a team as a code owner August 25, 2026 12:12
@bongjunj
bongjunj requested review from cfallin and removed request for a team August 25, 2026 12:12
@bongjunj
bongjunj requested a review from a team as a code owner August 25, 2026 12:47
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Aug 25, 2026
@github-actions

Copy link
Copy Markdown

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.

@fitzgen

fitzgen commented Aug 25, 2026

Copy link
Copy Markdown
Member

Do you have any plan to run the verifier for all existing midend/backend rules on a regular basis (like CI)?

Yes! See #13929 and #14207

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

Thansk!

@fitzgen
fitzgen added this pull request to the merge queue Aug 25, 2026
Merged via the queue into bytecodealliance:main with commit c8dfa03 Aug 25, 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