Stream: git-wasmtime

Topic: wasmtime / PR #9437 Implement the `ref.cast` Wasm GC inst...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:08):

fitzgen opened PR #9437 from fitzgen:ref-cast to bytecodealliance:main:

<!--
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 (Oct 10 2024 at 15:08):

fitzgen requested alexcrichton for a review on PR #9437.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:08):

fitzgen requested wasmtime-core-reviewers for a review on PR #9437.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:09):

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:

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 (Oct 10 2024 at 15:15):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:15):

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 update translate_ref_test with an argument along the lines of "what to do as the conclusion"? For example here the trapz could get propagated upwards to avoid creating so many basic blocks as part of translate_ref_test. For BrOnCast 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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:19):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:19):

fitzgen created PR review comment:

Yeah, certain things like trapzs (and jumps/brifs for br_on_cast[_fail]) could be propagated backwards into the ref.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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:22):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:22):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:33):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:33):

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 :)

view this post on Zulip Wasmtime GitHub notifications bot (Oct 10 2024 at 15:36):

fitzgen merged PR #9437.


Last updated: Nov 22 2024 at 16:03 UTC