Skip to content

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

Open
myunbin wants to merge 1 commit into
bytecodealliance:mainfrom
myunbin:add-rules-260904
Open

Cranelift: add/modify mid-end opt rules#14277
myunbin wants to merge 1 commit into
bytecodealliance:mainfrom
myunbin:add-rules-260904

Conversation

@myunbin

@myunbin myunbin commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Add new opt rules:

  • (x - y) == 0 ==> x == y
  • (x - y) != 0 ==> x != y
  • (x ^ y) == 0 ==> x == y
  • (x ^ y) != 0 ==> x != y
  • (x ^ y) == x ==> y == 0
  • (x + y) != x ==> y != 0
  • x != -y ==> x != y
  • (x == y) ? 0 : (x - y) ==> x - y
  • (c ? y : z) + (c ? z : y) ==> z + y
  • (x != y) ? (x - y) : 0 ==> x - y

Apply all_zero helper for existing rules:

  • x & 0 == 0 & x == x & not(x) == not(x) & x == 0

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

github-actions Bot commented Sep 4, 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.

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.

1 participant