jameysharp opened PR #8308 from jameysharp:aarch64-untyped
to bytecodealliance:main
:
Previously, the precondition on every use of AMode::*Offset was that the type specified in the address mode must be the same size as the access type of the memory instruction where the address mode was used.
However, at the point where we replace these magic address modes with real modes that the target architecture understands, we know what instruction is using the address, so we can get the type from there.
This simplifies constructing addresses while also ensuring that the types are always correct.
The changes here center around threading the access type through
mem_finalize
andAMode::pretty_print
, then deleting it from allAMode
variants.In the process I introduced a helper method on
Inst
to centralize the mapping from instruction to access type, and used that everywhere.
jameysharp requested cfallin for a review on PR #8308.
jameysharp requested wasmtime-compiler-reviewers for a review on PR #8308.
cfallin submitted PR review:
This seems quite sensible -- thanks! I think the original thought I had had was to keep the
AMode
self-describing as much as possible but this PR shows we have the type implicitly from context anywhere we need it and so it's nicer not to have a redundant encoding. So, very good cleanup.
jameysharp updated PR #8308.
jameysharp has enabled auto merge for PR #8308.
github-actions[bot] commented on PR #8308:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:aarch64", "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
jameysharp merged PR #8308.
Last updated: Dec 23 2024 at 13:07 UTC