Stream: git-wasmtime

Topic: wasmtime / PR #14327 Cranelift: add mid-end opt rules


view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 14:53):

myunbin opened PR #14327 from myunbin:add-rules-260914 to bytecodealliance:main:

Add new mid-end optimization rules:

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 14:53):

myunbin requested alexcrichton for a review on PR #14327.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 14:53):

myunbin requested wasmtime-compiler-reviewers for a review on PR #14327.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 15:06):

:thumbs_up: alexcrichton submitted PR review:

Thanks!

@avanhatt or @mmcloughlin would y'all be able to help out with the CI failure?

ERROR #1147 cranelift/codegen/src/opts/icmp.isle line 554   expanding constructor 'i64_gt': no spec for term i64_gt
ERROR #1148 cranelift/codegen/src/opts/icmp.isle line 562   expanding constructor 'i64_trailing_zeros': no spec for term i64_trailing_zeros

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 15:06):

:speech_balloon: alexcrichton created PR review comment:

This comment may be a copy/paste? (or maybe a forgotten inclusion?)

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 16:46):

github-actions[bot] added the label cranelift on PR #14327.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 16:46):

github-actions[bot] added the label isle on PR #14327.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 16:46):

github-actions[bot] commented on PR #14327:

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:

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

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 21:07):

avanhatt commented on PR #14327:

It looks like two ISLE external terms (i64_gt & i64_trailing_zeros), while not new in this PR, need specs because these new rules are the first to use them for in-scope features.

@myunbin would you be willing to try adding the new specs by following the examples in /Users/avh/research/wasmtime/cranelift/codegen/src/spec/opt.isle?

For example, similar to line 452:

(spec (i64_gt_eq x y) (provide (= result (bvsge x y))))

You can add:

(spec (i64_eq x y) (provide (= result (bvsgt x y))))

view this post on Zulip Wasmtime GitHub notifications bot (Sep 14 2026 at 21:08):

avanhatt edited a comment on PR #14327:

It looks like two ISLE external terms (i64_gt & i64_trailing_zeros), while not new in this PR, need specs because these new rules are the first to use them for in-scope features.

@myunbin would you be willing to try adding the new specs by following the examples in /Users/avh/research/wasmtime/cranelift/codegen/src/spec/opt.isle?

For example, similar to line 452:

(spec (i64_gt_eq x y) (provide (= result (bvsge x y))))

You can add:

(spec (i64_gt x y) (provide (= result (bvsgt x y))))

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2026 at 01:59):

myunbin updated PR #14327.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2026 at 02:01):

myunbin commented on PR #14327:

Hi @avanhatt, I just added some missing helper specs:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2026 at 02:01):

myunbin edited a comment on PR #14327:

@avanhatt Hi, I just added some missing helper specs:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2026 at 02:02):

myunbin edited a comment on PR #14327:

@avanhatt Hi, I've just added some missing helper specs:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2026 at 14:56):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2026 at 14:56):

:speech_balloon: alexcrichton created PR review comment:

To confirm, is this a rule you wanted to add in this PR? Or was this a stray copy/paste?

I don't see anything w/ srem in the below rules and I'd otherwise expect these rules to be in arithmetic.isle like the similar rule added in this PR, so I wanted to confirm.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2026 at 06:56):

myunbin updated PR #14327.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2026 at 07:03):

:memo: myunbin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2026 at 07:03):

:speech_balloon: myunbin created PR review comment:

Sorry for the delay.
I mistakenly added that comment.
I've pushed an update erasing it.

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2026 at 14:06):

alexcrichton added PR #14327 Cranelift: add mid-end opt rules to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2026 at 14:33):

:check: alexcrichton merged PR #14327.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2026 at 14:33):

alexcrichton removed PR #14327 Cranelift: add mid-end opt rules from the merge queue.


Last updated: Sep 20 2026 at 18:08 UTC