Stream: git-wasmtime

Topic: wasmtime / PR #12596 Cranelift: upgrade to regalloc2 0.14...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:27):

cfallin opened PR #12596 from cfallin:regalloc2-upgrade to bytecodealliance:main:

This builds on the work in bytecoealliance/regalloc2#254 and removes our use of OnceLock to construct MachineEnvs for the register allocator that contain Vecs of registers, instead using PRegSets that are truly constant data.

There's a little awkwardness and refactoring to make the necessary bits const fns, and I also had to remove a few debug_asserts because the necessary Eq comparisons seem not to be supported in const fn-land, but otherwise this is pretty mechanical.

As a result of switching to the new register traversal order based on bitsets rather than lists, the register assignments changed in a large fraction of our golden test outputs, so a majority of the diff exists in those bits (kept in separate commits here).

This is logically stacked on top of bytecodealliance/regalloc2#255 and bytecodealliance/regalloc2#256, and then an RA2 release; the Cargo.toml update here refers to version 0.14.0 which hasn't been released yet.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:27):

cfallin requested wasmtime-compiler-reviewers for a review on PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:27):

cfallin requested wasmtime-core-reviewers for a review on PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:27):

cfallin requested alexcrichton for a review on PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:27):

cfallin requested wasmtime-default-reviewers for a review on PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:27):

cfallin edited PR #12596:

This builds on the work in bytecodealliance/regalloc2#254 and removes our use of OnceLock to construct MachineEnvs for the register allocator that contain Vecs of registers, instead using PRegSets that are truly constant data.

There's a little awkwardness and refactoring to make the necessary bits const fns, and I also had to remove a few debug_asserts because the necessary Eq comparisons seem not to be supported in const fn-land, but otherwise this is pretty mechanical.

As a result of switching to the new register traversal order based on bitsets rather than lists, the register assignments changed in a large fraction of our golden test outputs, so a majority of the diff exists in those bits (kept in separate commits here).

This is logically stacked on top of bytecodealliance/regalloc2#255 and bytecodealliance/regalloc2#256, and then an RA2 release; the Cargo.toml update here refers to version 0.14.0 which hasn't been released yet.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:39):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:39):

alexcrichton created PR review comment:

FWIW while debug_assert_eq!(a, b) is not usable in const-contexts I think debug_assert!(a == b) should work to help keep these around

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:39):

alexcrichton created PR review comment:

Mind throwing a debug_assert! that XReg::SPECIAL_START == 30 here?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:39):

alexcrichton created PR review comment:

Like above I think this can be kept with debug_assert!(a == b)

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:40):

cfallin edited PR #12596:

This builds on the work in bytecodealliance/regalloc2#254 and removes our use of OnceLock to construct MachineEnvs for the register allocator that contain Vecs of registers, instead using PRegSets that are truly constant data.

There's a little awkwardness and refactoring to make the necessary bits const fns, and I also had to remove a few debug_asserts because the necessary Eq comparisons seem not to be supported in const fn-land, but otherwise this is pretty mechanical.

As a result of switching to the new register traversal order based on bitsets rather than lists, the register assignments changed in a large fraction of our golden test outputs, so a majority of the diff exists in those bits (kept in separate commits here).

view this post on Zulip Wasmtime GitHub notifications bot (Feb 14 2026 at 23:42):

cfallin updated PR #12596.

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

cfallin updated PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:00):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:00):

cfallin created PR review comment:

Done!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:00):

cfallin created PR review comment:

Ah, yep, that worked -- thanks.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:00):

cfallin created PR review comment:

Yep, the Eq impl for Reg is non-const but I pulled out the actual constant register number and asserted that directly.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:00):

cfallin has enabled auto merge for PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:12):

cfallin added PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. to the merge queue

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:36):

github-merge-queue[bot] removed PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. from the merge queue

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:42):

cfallin updated PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:42):

cfallin has enabled auto merge for PR #12596.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 00:56):

cfallin added PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. to the merge queue

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

github-merge-queue[bot] removed PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. from the merge queue

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 01:51):

cfallin commented on PR #12596:

Noting for purposes of ongoing CI frustration: DNS failure consistent over 4 retries when downloading the Rust toolchain in this job; retrying merge.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 15 2026 at 01:51):

cfallin added PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. to the merge queue

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

cfallin merged PR #12596.

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

cfallin removed PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. from the merge queue


Last updated: Feb 24 2026 at 04:36 UTC