Stream: git-wasmtime

Topic: wasmtime / issue #12716 Cranelift: ISLE: unify type param...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 04 2026 at 17:26):

avanhatt opened issue #12716:

Feature

Currently, Clif terms like iadd include type parameters in their ISLE declarations for opt, but not for lower. This makes it more difficult to provide a single specification for verification across both domains. From our previous discussions, this also seems more a result of the history of changes than a conscious design decision.

Midend: (iadd ty x y)

Lower: (iadd x y)

Benefit

More unified implementation, easier to maintain specs, can write specs where the type is necessary, for example, vector lanes.

Implementation

Commit with change, PR to come: https://github.com/avanhatt/wasmtime/commit/650a4cc6d695d1958bfa7a1b4a690959191142af

Alternatives

The current implementation uses a script to automatically add _ for the type parameter to the many, many relevant rules in the backend. We could instead manually audit these to e.g. remove many instances of has_ty that could now be simplified, but that would be harder to automate.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2026 at 08:29):

bongjunj commented on issue #12716:

I think some mid-end rules are having similar issues. For example, urem CLIF term in mid-end lacks type parameter, and this conflicts, if I recall correctly, conflicts with the arrival fork.

https://github.com/bytecodealliance/wasmtime/blob/511638f539f1914c5194fc6db286c099f3450ec3/cranelift/codegen/src/opts/cprop.isle#L50-L54

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2026 at 08:29):

bongjunj edited a comment on issue #12716:

I think some mid-end rules are having similar issues. For example, urem CLIF term in mid-end lacks type parameter, and this, if I recall correctly, conflicts with the arrival fork.

https://github.com/bytecodealliance/wasmtime/blob/511638f539f1914c5194fc6db286c099f3450ec3/cranelift/codegen/src/opts/cprop.isle#L50-L54


Last updated: Mar 23 2026 at 16:19 UTC