Stream: git-wasmtime

Topic: wasmtime / PR #13237 Type-guard bitop optimization rules ...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2026 at 05:17):

bongjunj opened PR #13237 from bongjunj:fix-13229 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
-->

Cause 1

bitops such as band, bor, ... are not constrained to receive only integer inputs like iadd, isub, and icmp.
The IR builder shows this fact:

Note that there is no float input for iadd, whereas band can take float inputs.

Cause 2

iconst_s and iconst_u provide convenient ways to construct constants on RHS, but they are the main contract breaker of ISLE type system. They are declared as non-partial terms, while their definition is not total. They only work for integer and vec128 types and this is why we need type guards to use them. This fact is not explicitly encoded in the declaration of the terms. I guess this is not a proper way to use ISLE, since we cannot trust the ISLE compiler and the ISLE ruleset in this way... But, to fix this, I guess we need more discussions that could easily go out of the scope of fix, so I want to leave this as a future work.

Fix

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2026 at 05:17):

bongjunj requested alexcrichton for a review on PR #13237.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2026 at 05:17):

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

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2026 at 05:18):

bongjunj edited PR #13237:

<!--
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 resolves #13229

Cause 1

bitops such as band, bor, ... are not constrained to receive only integer inputs like iadd, isub, and icmp.
The IR builder shows this fact:

Note that there is no float input for iadd, whereas band can take float inputs.

Cause 2

iconst_s and iconst_u provide convenient ways to construct constants on RHS, but they are the main contract breaker of ISLE type system. They are declared as non-partial terms, while their definition is not total. They only work for integer and vec128 types and this is why we need type guards to use them. This fact is not explicitly encoded in the declaration of the terms. I guess this is not a proper way to use ISLE, since we cannot trust the ISLE compiler and the ISLE ruleset in this way... But, to fix this, I guess we need more discussions that could easily go out of the scope of fix, so I want to leave this as a future work.

Fix

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2026 at 09:25):

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

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2026 at 09:25):

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

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

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

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 (Apr 30 2026 at 14:03):

:thumbs_up: alexcrichton submitted PR review:

Thanks! To bikeshed this a bit, maybe ty_int_or_vec128? The name ty_iconst can make sense in retrospect once it's understood what it does but just by reading it it's not clear.

Another possibility is ty_int_lane because in Cranelift I believe all types are considered to have lanes, and scalars just have one lane


Last updated: May 03 2026 at 22:13 UTC