Stream: git-wasmtime

Topic: wasmtime / PR #14024 Make `rc_for_type()` pass Type arg b...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2026 at 13:33):

Firestar99 opened PR #14024 from Firestar99:rc_for_type_by_ref to bytecodealliance:main:

This PR changes trait MachInst:

- fn rc_for_type(ty: Type) -> CodegenResult<(&'static [RegClass], &'static [Type])>;
+ fn rc_for_type(ty: &Type) -> CodegenResult<(&[RegClass], &[Type])>;

This change is trivial to support from all call sites, and allows implementors to:

- I8 => Ok((&[RegClass::Int], &[I8])),
- I16 => Ok((&[RegClass::Int], &[I16])),
- I32 => Ok((&[RegClass::Int], &[I32])),
- I64 => Ok((&[RegClass::Int], &[I64])),
- F32 => Ok((&[RegClass::Float], &[F32])),
- F64 => Ok((&[RegClass::Float], &[F64])),
+ I8 | I16 | I32 | I64 => Ok((&[RegClass::Int], core::slice::from_ref(ty))),
+ F32 | F64 => Ok((&[RegClass::Float], core::slice::from_ref(ty))),

Not sure how overall valuable this patch is. This function has just been annoying to implement for SSA-style IRs, where RegClass doesn't matter and it's just returning whatever type was passed.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2026 at 13:33):

Firestar99 requested wasmtime-compiler-s390x-reviewers for a review on PR #14024.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2026 at 13:33):

Firestar99 requested fitzgen for a review on PR #14024.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 30 2026 at 13:33):

Firestar99 requested wasmtime-compiler-reviewers for a review on PR #14024.

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

fitzgen commented on PR #14024:

This function has just been annoying to implement for SSA-style IRs, where RegClass doesn't matter and it's just returning whatever type was passed.

Can you clarify what you are doing here? Are you adding an SSA-style IR as a new backend to Cranelift?

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

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

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

github-actions[bot] added the label cranelift:area:machinst on PR #14024.

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

github-actions[bot] added the label cranelift:area:aarch64 on PR #14024.

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

github-actions[bot] added the label cranelift:area:x64 on PR #14024.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 13 2026 at 16:32):

fitzgen commented on PR #14024:

@Firestar99 friendly ping on the question above

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

:thumbs_up: fitzgen submitted PR review:

LGTM, thanks!

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

fitzgen added PR #14024 Make rc_for_type() pass Type arg by reference instead of value to the merge queue.

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

:check: fitzgen merged PR #14024.

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

fitzgen removed PR #14024 Make rc_for_type() pass Type arg by reference instead of value from the merge queue.


Last updated: Aug 30 2026 at 09:07 UTC