Skip to content

[6.0] [IRGen] Fix misalignment of conditional invertible requirement counts #74014

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 2 commits into from
May 30, 2024

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented May 30, 2024

This is a cherry pick of #73277 and #73384

Explanation: The conditional invertible protocol set is alone as a 16 bit slot in the generic context, but items here are expected to be 4 bytes large, so some padding needs to accompany this value. If the number of invertible protocols that we're conditional on is even, we can stick a 0 after all of the requirement counts. Also, we were using countBitsUsed to determine how many requirement counts there were, but this is really testing the first bit in [1, 64] that is turned on instead of actually saying how many bits are turned on.

Scope: Compiler
Issue: None.
Original PR: #73277 and #73384
Risk: Very low, nobody is currently using conditional invertible requirements besides the stdlib and we haven't committed to this ABI yet.
Testing: CI
Reviewer: @DougGregor

Azoy added 2 commits May 30, 2024 10:05
[IRGen] Fix misalignment of conditional invertible requirement counts
[Basic] Manually implement popcount when not available
@Azoy Azoy requested a review from a team as a code owner May 30, 2024 17:10
@Azoy
Copy link
Contributor Author

Azoy commented May 30, 2024

@swift-ci please test

@Azoy Azoy merged commit 36f6d30 into swiftlang:release/6.0 May 30, 2024
@Azoy Azoy deleted the 60-fix-invertible-abi branch May 30, 2024 23:43
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