Skip to content

Fix ISLE icmp optimization rules for vector inputs#12335

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
zzjas:issue-12328
Jan 13, 2026
Merged

Fix ISLE icmp optimization rules for vector inputs#12335
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
zzjas:issue-12328

Conversation

@zzjas

@zzjas zzjas commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Add fits_in_64 for a few icmp optimization rules to avoid matching 128-bit vectors. Rules at line 320 - 351 are contrained by iconst_s so don't need the fix.

Closes #12328

@zzjas
zzjas requested a review from a team as a code owner January 13, 2026 20:58
@zzjas
zzjas requested review from alexcrichton and removed request for a team January 13, 2026 20:58
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator isle Related to the ISLE domain-specific language labels Jan 13, 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.

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

Thanks!

@alexcrichton
alexcrichton added this pull request to the merge queue Jan 13, 2026
Merged via the queue into bytecodealliance:main with commit 44a9c22 Jan 13, 2026
45 checks passed
alexcrichton added a commit that referenced this pull request Jan 14, 2026
Closes #12328

Co-authored-by: Zijie Zhao <zzjas98@gmail.com>
cfallin pushed a commit that referenced this pull request Jan 14, 2026
* Fix ISLE optimization for vector inputs (#12179)

Add some more `fits_in_64` constraints to types to handle the fact that
`iconst_u` can't construct a 128-bit output.

Closes #12170

* x64: Fix lowering rules for `shld` (#12321)

* x64: Fix lowering rules for `shld`

These failed to account for the edge case of 0/width(type) shifts where
the `shld` instruction is no longer applicable. Guards are added to
ensure that the shift amounts are both greater than zero.

This in theory shouldn't have much practical impact since shift-by-zero
and shift-by-type-width are both optimized away in the mid-end. That
means that this is only possible to expose with opt-level=0 which may
help explain why this went undiscovered for ~1 year.

Closes #12318

* Fix Winch's encoding of shift-by-32

* Fix ISLE icmp optimization rules for vector inputs (#12335)

Closes #12328

* Add release notes

---------

Co-authored-by: Zijie Zhao <zzjas98@gmail.com>
@zzjas
zzjas deleted the issue-12328 branch January 30, 2026 23:07
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.

Cranelift: Missing type constraint in ISLE icmp rules causes panic on vector types

2 participants