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
OnceLockto constructMachineEnvs for the register allocator that containVecs of registers, instead usingPRegSets 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 fewdebug_asserts because the necessaryEqcomparisons seem not to be supported inconst 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.tomlupdate here refers to version 0.14.0 which hasn't been released yet.
cfallin requested wasmtime-compiler-reviewers for a review on PR #12596.
cfallin requested wasmtime-core-reviewers for a review on PR #12596.
cfallin requested alexcrichton for a review on PR #12596.
cfallin requested wasmtime-default-reviewers for a review on PR #12596.
cfallin edited PR #12596:
This builds on the work in bytecodealliance/regalloc2#254 and removes our use of
OnceLockto constructMachineEnvs for the register allocator that containVecs of registers, instead usingPRegSets 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 fewdebug_asserts because the necessaryEqcomparisons seem not to be supported inconst 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.tomlupdate here refers to version 0.14.0 which hasn't been released yet.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
FWIW while
debug_assert_eq!(a, b)is not usable in const-contexts I thinkdebug_assert!(a == b)should work to help keep these around
alexcrichton created PR review comment:
Mind throwing a
debug_assert!thatXReg::SPECIAL_START == 30here?
alexcrichton created PR review comment:
Like above I think this can be kept with
debug_assert!(a == b)
cfallin edited PR #12596:
This builds on the work in bytecodealliance/regalloc2#254 and removes our use of
OnceLockto constructMachineEnvs for the register allocator that containVecs of registers, instead usingPRegSets 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 fewdebug_asserts because the necessaryEqcomparisons seem not to be supported inconst 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).
cfallin updated PR #12596.
cfallin updated PR #12596.
cfallin submitted PR review.
cfallin created PR review comment:
Done!
cfallin created PR review comment:
Ah, yep, that worked -- thanks.
cfallin created PR review comment:
Yep, the
Eqimpl forRegis non-const but I pulled out the actual constant register number and asserted that directly.
cfallin has enabled auto merge for PR #12596.
cfallin added PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. to the merge queue
github-merge-queue[bot] removed PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. from the merge queue
cfallin updated PR #12596.
cfallin has enabled auto merge for PR #12596.
cfallin added PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. to the merge queue
github-merge-queue[bot] removed PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. from the merge queue
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.
cfallin added PR #12596 Cranelift: upgrade to regalloc2 0.14.0 and use static/constant MachineEnvs. to the merge queue
cfallin merged PR #12596.
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