Stream: git-wasmtime

Topic: wasmtime / PR #13850 Cranelift: Add(and modify) simplific...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 05:26):

myunbin opened PR #13850 from myunbin:add-rules-20260709-012308 to bytecodealliance:main:

Add and modify simplification rules.

arithmetic.isle

bitops.isle

extends.isle

icmp.isle

shifts.isle

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 05:26):

myunbin requested fitzgen for a review on PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 05:26):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 05:34):

myunbin edited PR #13850:

Add and modify simplification rules.

arithmetic.isle

bitops.isle

extends.isle

icmp.isle

shifts.isle

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 05:38):

myunbin requested wasmtime-core-reviewers for a review on PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 05:38):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 05:45):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 06:06):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 06:38):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 06:41):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 06:51):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 07:27):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 10:04):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 10:04):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 10:05):

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

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:

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 (Jul 09 2026 at 19:31):

:memo: fitzgen submitted PR review:

LGTM, modulo one small concern below. Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 19:31):

:speech_balloon: fitzgen created PR review comment:

We allow bxor on floats and vector types and I suspect that this changed rule may break when given a float or vector of floats. Can you add a filetest for bxor x, x on those types if we don't already have one, and make sure that it passes?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2026 at 19:31):

:speech_balloon: fitzgen created PR review comment:

Ah okay, here is the test.

Can we also exercise floats and a vector of floats? Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 05:49):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 06:18):

myunbin commented on PR #13850:

@fitzgen As you suspected, bxor did not work for floats or vectors of floats. I updated
the rule to support both cases and added tests.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 06:19):

myunbin edited a comment on PR #13850:

@fitzgen As you suspected, bxor did not work for floats or vectors of floats. I updated
the rule to support both cases and added tests. Thanks for pointing it out!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 06:27):

myunbin updated PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 06:28):

:memo: myunbin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 06:28):

:speech_balloon: myunbin created PR review comment:

Add an all-zero helper for float and vector types.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 15:19):

:memo: fitzgen submitted PR review:

Thanks! One last question below about the new all_zero helper

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2026 at 15:19):

:speech_balloon: fitzgen created PR review comment:

Is it more efficient to load zeros by splatting than via loads from the constant pool?

It seems like we don't have any terms in the mid-end's prelude for working with ir::Constants, but they would be easy to add if necessary.

But if splatting is expected to be more efficient, then we should add a comment to that effect here.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 01:01):

:memo: myunbin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2026 at 01:01):

:speech_balloon: myunbin created PR review comment:

@fitzgen

I did not use splatting for efficiency reasons, but because there is an existing rule that rewrites constant splats to vconst for vec128(I don't think there is an equivalent rule for vec64).

https://github.com/bytecodealliance/wasmtime/blob/9aca9f50ceeceb117911873bc7b86c324876b277/cranelift/codegen/src/opts/cprop.isle#L276-L287

I believe adding ir::Constant helpers may be a better approach.

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2026 at 16:11):

:memo: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2026 at 16:11):

:speech_balloon: fitzgen created PR review comment:

(sorry for the delayed response, just got back from vacation)

Okay, I'll go ahead and enqueue this PR for merging, but regarding this:

I believe adding ir::Constant helpers may be a better approach.

Would you be interested in investigating adding ir::Constant helpers and improving these rules in a follow up PR?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2026 at 16:11):

:thumbs_up: fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2026 at 16:11):

fitzgen added PR #13850 Cranelift: Add(and modify) simplification rules to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2026 at 16:37):

:check: fitzgen merged PR #13850.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2026 at 16:37):

fitzgen removed PR #13850 Cranelift: Add(and modify) simplification rules from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2026 at 11:17):

:memo: myunbin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 21 2026 at 11:17):

:speech_balloon: myunbin created PR review comment:

Sure. I’ll take a look and add some ir::Constant helpers.


Last updated: Jul 29 2026 at 05:03 UTC