Stream: git-wasmtime

Topic: wasmtime / PR #10080 pulley: Slightly optimize bounds checks


view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:03):

alexcrichton requested fitzgen for a review on PR #10080.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:03):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #10080.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:03):

alexcrichton opened PR #10080 from alexcrichton:pulley-more-bounds-checks to bytecodealliance:main:

In profiling a module I was noticing that the previous xbc32_bound_trap instruction wasn't being used when I expected. Investigation revealed that the load of the bound itself was GVN'd and deduplicated (yay!) but it meant that the load was used in two locations meaning it didn't pass checks for sinkable_load. This commit fixes this by repurposing xbc32_bound_trap for "the bound is in a register" and renaming the previous instruction to xbc32_boundne_trap. This helps cut down on the number of opcodes in this benchmark and improves performance slightly.

At the same time this tightens up "sinkable loads" to require native endianness since that's what the bound of memory is stored as. Additionally in addition to testing for a < b and optimizing that this also now optimizes b > a, the same condition just having the arguments swapped.

<!--
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 (Jan 22 2025 at 20:03):

alexcrichton requested wasmtime-core-reviewers for a review on PR #10080.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:03):

alexcrichton requested wasmtime-default-reviewers for a review on PR #10080.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:11):

alexcrichton updated PR #10080.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:37):

alexcrichton updated PR #10080.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:48):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 20:48):

fitzgen has enabled auto merge for PR #10080.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 22 2025 at 21:13):

fitzgen merged PR #10080.


Last updated: Feb 28 2025 at 02:27 UTC