Stream: git-wasmtime

Topic: wasmtime / PR #7280 PCC: merge/propagate facts through eg...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2023 at 04:23):

cfallin requested fitzgen for a review on PR #7280.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2023 at 04:23):

cfallin requested wasmtime-compiler-reviewers for a review on PR #7280.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2023 at 04:23):

cfallin opened PR #7280 from cfallin:pcc-opts to bytecodealliance:main:

This turns out to be quite simple: the fundamental operation during egraph-based optimization is to merge eclasses, which is an assertion that their value is equal. Since the values of either side of the merge are equal, a fact about one side is a fact about the other, and vice-versa.

Since we only support one fact at most per value, we can't take the union of all facts; instead, if one side is missing a fact, or if both sides have exactly the same fact, we keep that one; otherwise we go to a special "conflict" fact that can't support any check. This is edging closer to a fact-lattice, but I opted not to go there with a full meet-function merge yet, for simplicity. (It's a little complex because of the "minimum fact" we can know about a value based on its type -- if we're going to do something better, I think we should account for that too.)

In any case, that complexity mostly isn't needed, because the two cases that happen in reality are (i) opt rules rewrite to a new node, which will have no facts at all, so facts just propagate; or (ii) GVN merges two values in the input program into one, but if both are the same value, in practice the Wasm PCC frontend (for example) should be producing the same facts on both values, so the merge is trivial.

<!--
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 18 2023 at 15:50):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2023 at 16:35):

fitzgen merged PR #7280.


Last updated: Nov 22 2024 at 16:03 UTC