Stream: git-wasmtime

Topic: wasmtime / PR #9666 pulley: Remove special registers as c...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 22:54):

alexcrichton opened PR #9666 from alexcrichton:remove-some-registers to bytecodealliance:main:

This commit fixes a minor mistake where regalloc was allowed to allocate "special registers" such as the stack pointer, the frame pointer, etc. These register shouldn't participate in general-purpose register allocation, so they're removed from the list of non-preferred registers when metadata is provided to regalloc2.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 22:54):

alexcrichton requested cfallin for a review on PR #9666.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 22:54):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #9666.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 22:54):

alexcrichton requested wasmtime-default-reviewers for a review on PR #9666.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 22:59):

cfallin submitted PR review:

Good catch!

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 22:59):

cfallin created PR review comment:

Do we have constants for sp and fp? Can we define them like SPECIAL_START + 0 and SPECIAL_START + 1 to ensure this stays in sync?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:02):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:02):

alexcrichton created PR review comment:

Does this test do what you're thinking?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:12):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:12):

cfallin created PR review comment:

That tests the other direction: it asserts that every register from SPECIAL_START onward is special, but it doesn't test that every special register is beyond SPECIAL_START. I guess I'm suggesting a different way to define fp and sp, where we use the constant (plus a nonnegative offset) directly to have this by construction.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:17):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:17):

alexcrichton created PR review comment:

Ah good point! The way these are defined in pulley is a bit special right now where each register is an enum XReg { x0, ... sp, ... } for example. That's uniform across x/f/v registers so I'm wary to change that much. That being said I'll enhance the test to assert that everything before SPECIAL_START is non-special.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:18):

alexcrichton updated PR #9666.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:26):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:26):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:26):

cfallin created PR review comment:

Looks good!

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:27):

cfallin has enabled auto merge for PR #9666.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:28):

alexcrichton has disabled auto merge for PR #9666.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:28):

alexcrichton has enabled auto merge for PR #9666.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 22 2024 at 23:50):

alexcrichton merged PR #9666.


Last updated: Jan 09 2026 at 13:15 UTC