alexcrichton opened PR #6971 from alexcrichton:opt-lift-lower-for-primitives
to bytecodealliance:main
:
This commit optimizes the lifting and lowering routines for
list<u8>
and other similar primitive integer types. The current lifting/lowering is intended to be general-purpose and correct but doesn't optimize well with LLVM for a number of reasons. I first attempted to reshape the general-purpose code to be easier for LLVM to optimize but in the end was unable to convince LLVM that various pointers here don't alias which meant that the general-purpose lowering/lifting never optimized well.Instead, however, I've added new trait methods which are implemented the same way as the general purpose methods beforehand. The integer/primitive implementations overwrite these implementations with more specialized versions given knowledge of primitives.
On a local benchmark this makes lifting/lowering disappear from a profile since memcpy is generally much faster than per-item processing.
<!--
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 requested pchickey for a review on PR #6971.
alexcrichton requested wasmtime-core-reviewers for a review on PR #6971.
pchickey submitted PR review:
Awesome!
alexcrichton merged PR #6971.
Last updated: Nov 22 2024 at 17:03 UTC