Stream: git-wasmtime

Topic: wasmtime / PR #5909 Allow hoisting `vconst` instructions ...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 05:42):

alexcrichton opened PR #5909 from licm-vconst to main:

Staring at some SIMD code and what LLVM and v8 both generate it appears that a common technique for SIMD-loops is to hoist constants outside of loops since they're nontrivial to rematerialize unlike integer constants. This commit updates the loop_hoist_level calculation with egraphs to have a nonzero default for instructions that have no arguments (e.g. consts) which enables hoisting these instructions out of loops.

Note, though, that for now I've listed the maximum as hoisting outside of one loop, but not all of them. While theoretically vconsts could move up to the top of the function I'd be worried about their impact on register pressure and having to save/restore around calls or similar, so hopefully if the hot part of a program is a single loop then hoisting out of one loop is a reasonable-enough heuristic for now.

Locally on x64 with a benchmark that just encodes binary to hex this saw a 15% performance improvement taking hex encoding from ~6G/s to ~6.7G/s.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 19:16):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 03 2023 at 00:56):

alexcrichton updated PR #5909 from licm-vconst to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 06 2023 at 15:08):

alexcrichton closed without merge PR #5909.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 06 2023 at 15:08):

alexcrichton reopened PR #5909 from licm-vconst to main.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 06 2023 at 15:08):

alexcrichton has enabled auto merge for PR #5909.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 06 2023 at 16:03):

alexcrichton merged PR #5909.


Last updated: Dec 23 2024 at 12:05 UTC