Skip to content

[AST] Stop using PointerIntPair for SIL params/results #32646

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

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

davezarzycki
Copy link
Contributor

The differentiability bit pushed the size of SILParameterInfo and SILResultInfo from 8 bytes to 16 bytes. Given that the low bits of the PointerIntPair are full and given that we do not want to over-align types, the PointerIntPair is not saving space anymore. Let's simplify these two data structures to make debugging easier (and the speed of debug builds slightly faster). In theory, release builds will also benefit due to fewer masking operations to extract the pointer or the low bits, but this will probably be "in the noise" for benchmarks.

Note: this change is techinically not NFC because it fixes the SILResultInfo equality comparison function to check differentiability.

The differentiability bit pushed the size of SILParameterInfo and
SILResultInfo from 8 bytes to 16 bytes. Given that the low bits of the
PointerIntPair are full and given that we do not want to over-align
types, the PointerIntPair is not saving space anymore. Let's simplify
these two data structures to make debugging easier (and the speed of
debug builds slightly faster). In theory, release builds will also
benefit due to fewer masking operations to extract the pointer or the
low bits, but this will probably be "in the noise" for benchmarks.

Note: this change is techinically not NFC because it fixes the
SILResultInfo equality comparison function to check differentiability.
@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test

@davezarzycki davezarzycki requested a review from rjmccall July 1, 2020 13:37
@davezarzycki
Copy link
Contributor Author

Hi @jckarter and @rjmccall – Any chance we can bless using the high-byte on x86-64 and arm64 platforms to pack data structures more efficiently?

@jckarter
Copy link
Contributor

jckarter commented Jul 1, 2020

It would be nice to have a BigPointerIntPair that used the high byte on 64-bit platforms but was an int32_t; int8_t pair on 32-bit (or 64-bit platforms that don't want to guarantee they'll give up the high byte).

@davezarzycki davezarzycki merged commit 3e59cc4 into swiftlang:master Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants