Stream: git-wasmtime

Topic: wasmtime / PR #11637 [Cranelift] fold shifts over bitwise...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 08 2025 at 12:42):

bongjunj opened PR #11637 from bongjunj:fold-shifts-over-and to bytecodealliance:main:

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

This adds (rule (simplify (ushr ty (band ty (ishl ty x y) z) y)) (band ty x (ushr ty z y))).

view this post on Zulip Wasmtime GitHub notifications bot (Sep 08 2025 at 12:42):

bongjunj requested abrown for a review on PR #11637.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 08 2025 at 12:42):

bongjunj requested wasmtime-compiler-reviewers for a review on PR #11637.

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

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

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 (Sep 09 2025 at 17:29):

fitzgen submitted PR review:

Thanks!

We can do the equivalent with sshr as well, right? Would you be willing to do a follow up PR adding that rule?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 01:06):

bongjunj commented on PR #11637:

Thank you for the comment. I will add the rule in this PR.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 06:11):

bongjunj commented on PR #11637:

@fitzgen

The verifier rejects the sshr case.

Verification failed for <unnamed rule>, width 8
(simplify (sshr [ty|8] (band [ty|8] (ishl [ty|8] [x|#x01] [y|#x07]) [z|#x80]) [y|#x07]))
=>
(band [ty|8] [x|#x01] (sshr [ty|8] [z|#x80] [y|#x07]))

#xff => #x01

I've tried the other cases of ushr, sshr and sshr, ushr.
But this rule is correct only when band folds two ushrs.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 06:13):

bongjunj updated PR #11637.

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

bongjunj updated PR #11637.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 20:01):

fitzgen commented on PR #11637:

Thanks for checking!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 20:41):

fitzgen merged PR #11637.


Last updated: Dec 06 2025 at 06:05 UTC