-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize list<u8>
lifting and lowering
#6971
Merged
alexcrichton
merged 1 commit into
bytecodealliance:main
from
alexcrichton:opt-lift-lower-for-primitives
Sep 6, 2023
Merged
Optimize list<u8>
lifting and lowering
#6971
alexcrichton
merged 1 commit into
bytecodealliance:main
from
alexcrichton:opt-lift-lower-for-primitives
Sep 6, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
github-actions
bot
added
the
wasmtime:api
Related to the API of the `wasmtime` crate itself
label
Sep 6, 2023
Subscribe to Label Actioncc @peterhuene
This issue or pull request has been labeled: "wasmtime:api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
pchickey
approved these changes
Sep 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
eduardomourar
pushed a commit
to eduardomourar/wasmtime
that referenced
this pull request
Sep 6, 2023
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.
alexcrichton
added a commit
that referenced
this pull request
Sep 12, 2023
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.