Stream: git-wasmtime

Topic: wasmtime / PR #11213 Add option to use regalloc3 as the r...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:52):

Amanieu opened PR #11213 from Amanieu:regalloc3 to bytecodealliance:main:

This is based on https://github.com/bytecodealliance/regalloc2/pull/230 which adds regalloc3 as a back-end to regalloc2.

Only one change had to be made to codegen: tail calls were reserving r11 as a scratch register by making it a def on the return instruction. This is not supported by regalloc3, which allows it extends all live ranges to the end of ret instruction so that the live range segment can merge with the next one. Since a def on a return instruction is meaningless, I've changed it to a hard-coded register in the emit stage instead.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:52):

Amanieu requested cfallin for a review on PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:52):

Amanieu requested alexcrichton for a review on PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:52):

Amanieu requested wasmtime-core-reviewers for a review on PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:52):

Amanieu requested wasmtime-compiler-reviewers for a review on PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:52):

Amanieu requested wasmtime-default-reviewers for a review on PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 16:55):

Amanieu updated PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 18:07):

Amanieu updated PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 20:46):

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

Subscribe to Label Action

cc @cfallin, @fitzgen

<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:machinst", "cranelift:area:x64", "cranelift:meta", "isle", "wasmtime:api", "wasmtime:config"

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 (Jul 10 2025 at 21:46):

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

Label Messager: wasmtime:config

It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:

[fuzzing-config]: https://github.com/bytecodealliance/wasmtime/blob/ca0e8d0a1d8cefc0496dba2f77a670571d8fdcab/crates/fuzzing/src/generators.rs#L182-L194
[fuzzing-docs]: https://docs.wasmtime.dev/contributing-fuzzing.html


<details>

To modify this label's message, edit the <code>.github/label-messager/wasmtime-config.md</code> file.

To add new label messages or remove existing label messages, edit the
<code>.github/label-messager.json</code> configuration file.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 23:58):

Amanieu updated PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 11 2025 at 03:17):

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

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "fuzzing"

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 (Jul 14 2025 at 18:55):

fitzgen submitted PR review:

LGTM modulo comment below, removing the [patch.crates-io] bits when upstream is ready, and getting CI passing.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2025 at 18:55):

fitzgen created PR review comment:

This might be true for our current calling conventions, but is not guaranteed to continue to hold true in the future. As such, could you assert that call_info.uses doesn't contain any uses of r11 to future proof this code?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2025 at 23:15):

Amanieu submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 14 2025 at 23:15):

Amanieu created PR review comment:

Actually, I've been over-thinking this. We can keep the existing code and just change it to an early-def, which is allowed by regalloc3 on return instructions. It could even be changed to an arbitrary register constraint in the future once regalloc2 support is dropped.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2025 at 15:20):

Amanieu updated PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2025 at 15:21):

Amanieu updated PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2025 at 15:21):

Amanieu submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2025 at 15:21):

Amanieu created PR review comment:

Actually an arbitrary register wouldn't work since it could conflict with callee-saved registers. I've added the assert as you suggested.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 16 2025 at 15:24):

Amanieu commented on PR #11213:

Regarding CI, there are currently 3 issues:

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2025 at 14:51):

cfallin closed without merge PR #11213.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 23 2025 at 14:51):

cfallin commented on PR #11213:

As noted in bytecodealliance/regalloc2#230, Cranelift maintainers have decided not to take regalloc3 at this time due to maintenance-burden concerns, so I'll go ahead and close this. Thank you for all the effort regardless!


Last updated: Dec 06 2025 at 07:03 UTC