abrown opened PR #9504 from abrown:refactor-amode to bytecodealliance:main:
There is no need for a
SyntheticAmodeto request mutable access to the entireEmitState; it only needs a read-onlyFrameLayout.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
abrown requested elliottt for a review on PR #9504.
abrown requested wasmtime-compiler-reviewers for a review on PR #9504.
cfallin submitted PR review.
cfallin has enabled auto merge for PR #9504.
What I'm aiming at is allowing any new assembler code to be ignorant of as much of the internals of
cranelift-codegenas possible. I think this will make it easier to test, etc. It really would be nice if the assembler didn't need to know aboutSyntheticAmodeat all; if aSyntheticAmodecould be finalized down into its equivalentAmodebefore the assembler ever sees it, that would be a good simplification. But all of theGprMemtypes and such point atSyntheticAmodes...
abrown updated PR #9504.
Oh, sorry, had to fix some build issues so I force-pushed!
cfallin commented on PR #9504:
Interesting; in an old version of the MachInst backend, there was actually a separate pass to rewrite
SyntheticAmodes, but we try to avoid separate passes and I don't think we have info to lower them when generating the instructions because they depend on details only known after regalloc, like frame layout. Perhaps one could design a way with parameterization of the enum (e.g.Inst<A: Into<Amode>>) and then a method to "lift" the into toInst(Haskell brain: I wantfmap)?
cfallin merged PR #9504.
Last updated: Dec 13 2025 at 19:03 UTC