Optimize tail-padding reuse [NFC] - #9084
Open
kripken wants to merge 4 commits into
Open
Conversation
aheejin
approved these changes
Sep 10, 2026
aheejin
left a comment
Member
There was a problem hiding this comment.
Nice idea!
Gemini suggested we can make these further improvements. I haven't checked them by myself though. (Also not necessarily in this PR)
- Call: Move bool isReturn to the top (64 -> 56 bytes)
- CallIndirect: Move bool isReturn to the top (80 -> 72 bytes)
- CallRef: Move bool isReturn to the top (64 -> 56 bytes)
- I31Get: Move bool signed_ to the top (32 -> 24 bytes)
- AtomicRMW: Move MemoryOrder order to the top (64 -> 56 bytes)
- AtomicCmpxchg: Move MemoryOrder order to the top (64 -> 56 bytes)
- StructRMW: Move MemoryOrder order to the top (48 -> 40 bytes)
- StructCmpxchg: Move MemoryOrder order to the top (48 -> 40 bytes)
- ArrayRMW: Move MemoryOrder order to the top (48 -> 40 bytes)
- ArrayCmpxchg: Move MemoryOrder order to the top (56 -> 48 bytes)
- SIMDReplace: Move uint8_t index to the top (40 -> 32 bytes)
This file contains hidden or 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
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.
One some ABIs, if a base class ends with padding, derived classes right after it
can reuse that padding, placing their data there. This PR optimizes the key
Expression class that way.
Size changes on linux64 (common classes):
On 5 real-world binaries I tested, this reduced peak RAM usage by
3%, 4%, 6%, 9%, 9%.