fitzgen opened PR #9437 from fitzgen:ref-cast
to bytecodealliance:main
:
<!--
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
-->
fitzgen requested alexcrichton for a review on PR #9437.
fitzgen requested wasmtime-core-reviewers for a review on PR #9437.
fitzgen edited PR #9437:
Just building on top of our existing
ref.test
support and trapping if the test fails.<!--
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
-->
alexcrichton submitted PR review.
alexcrichton created PR review comment:
I can sort of see how this is going to get used for
BrOnCast
and such as well. Would it make sense to updatetranslate_ref_test
with an argument along the lines of "what to do as the conclusion"? For example here thetrapz
could get propagated upwards to avoid creating so many basic blocks as part oftranslate_ref_test
. ForBrOnCast
and friend it could be used for "I already created the blocks and I'm telling you where to jump".Basically there's cleanups we can do here in the frontend which Cranelift will not do in the mid-end. I don't know whether the better answer is to invest in the mid-end, assume that
MachBuffer
cleans up everything, or try to produce better IR here in the first place.
fitzgen submitted PR review.
fitzgen created PR review comment:
Yeah, certain things like
trapz
s (andjump
s/brif
s forbr_on_cast[_fail]
) could be propagated backwards into theref.test
implementation. I think long-term we want the mid-end to be able to clean this stuff up, just from a separation-of-concerns point of view.I can add an item to the running list of optimizations/code quality improvements for this.
alexcrichton created PR review comment:
Yeah I just fear that we've talked for a very long time about theoretical mid-end cleanups to basic blocks but haven't gotten to them, so it seems like it's probably easier to do it here than the mid-end.
alexcrichton submitted PR review.
fitzgen submitted PR review.
fitzgen created PR review comment:
Yeah, quite possible it is easier in the front end for now. Either way, not doing it as part of this PR :)
fitzgen merged PR #9437.
Last updated: Nov 22 2024 at 16:03 UTC