Stream: git-wasmtime

Topic: wasmtime / PR #8387 cranelift: Represent RealReg using PR...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2024 at 20:58):

jameysharp opened PR #8387 from jameysharp:realreg-is-physical-reg to bytecodealliance:main:

Semantically, a "real register" is supposed to be a physical register, so let's use the type dedicated for that purpose.

This has the advantage that PReg is only one byte while VReg is four bytes, so the arrays where we record collections of RealReg become smaller.

There was an implementation of From<VReg> for RealReg which was not a sensible conversion, because not all VRegs are valid RealRegs. I could have replaced it with a TryFrom implementation but it wasn't used anywhere important, so I'm just deleting it instead.

Winch was using that VReg->RealReg conversion, but only in the implementation of another conversion that was itself unused, so I'm deleting that conversion as well. It's easy to implement correctly (the Winch Reg type is identical to RealReg, so all conversions for the latter are readily available) but as far as I can tell Winch doesn't need to use Cranelift's register wrappers or RA2's virtual register type, so it's simpler to just delete those conversions.

The riscv64 backend was relying on quirks of the existing conversions between RealReg and VReg when emitting clobber saves and restores. Just using the generic conversions between RealReg and Reg is simpler and works correctly with the rest of these changes.

cc: @elliottt

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2024 at 20:58):

jameysharp requested wasmtime-compiler-reviewers for a review on PR #8387.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2024 at 20:58):

jameysharp requested elliottt for a review on PR #8387.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2024 at 21:04):

elliottt submitted PR review:

Very nice cleanup, thank you!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 16 2024 at 21:44):

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

Subscribe to Label Action

cc @saulecabrera

<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:machinst", "winch"

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 (Apr 16 2024 at 22:03):

jameysharp merged PR #8387.


Last updated: Oct 23 2024 at 20:03 UTC