Skip to content

[ARM, AArch64] Fix passing of structures with aligned base classes #18091

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
Apr 22, 2025

Conversation

hvdijk
Copy link
Contributor

@hvdijk hvdijk commented Apr 18, 2025

RecordLayout::UnadjustedAlignment was documented as "Maximum of the alignments of the record members in characters", but RecordLayout::getUnadjustedAlignment(), which just returns UnadjustedAlignment, was documented as getting "the record alignment in characters, before alignment adjustement." These are not the same thing: the former excludes alignment of base classes, the latter takes it into account. ItaniumRecordLayoutBuilder::LayoutBase was setting it according to the former, but the AAPCS calling convention handling, currently the only user, relies on it being set according to the latter.

Fixes LLVM #135551.

…135564)

RecordLayout::UnadjustedAlignment was documented as "Maximum of the
alignments of the record members in characters", but
RecordLayout::getUnadjustedAlignment(), which just returns
UnadjustedAlignment, was documented as getting "the record alignment in
characters, before alignment adjustement." These are not the same thing:
the former excludes alignment of base classes, the latter takes it into
account. ItaniumRecordLayoutBuilder::LayoutBase was setting it according
to the former, but the AAPCS calling convention handling, currently the
only user, relies on it being set according to the latter.

Fixes #135551.
@hvdijk hvdijk requested a review from a team as a code owner April 18, 2025 10:27
@hvdijk
Copy link
Contributor Author

hvdijk commented Apr 18, 2025

This is a cherry-pick from a commit that has been accepted into upstream LLVM. It affects DPC++ especially, because libsycl is affected by the ABI break: when DPC++ is built with GCC for AArch64, it contains several functions such as vector versions of ldexp that Clang then cannot call.

@Fznamznon
Copy link
Contributor

Is waiting for the pulldown not acceptable?

@hvdijk
Copy link
Contributor Author

hvdijk commented Apr 22, 2025

I wouldn't quite go as far as calling it unacceptable, but it will be several weeks before the pulldown includes it, and this causes an error every time in oneAPI Construction Kit's nightly AArch64 testing against SYCL-CTS. It would be quite useful for us to have that working reliably.

@hvdijk
Copy link
Contributor Author

hvdijk commented Apr 22, 2025

This is ready to be merged @intel/llvm-gatekeepers

@kbenzie kbenzie merged commit 0c60d95 into intel:sycl Apr 22, 2025
28 of 29 checks passed
vinser52 pushed a commit to sergey-semenov/llvm that referenced this pull request Apr 22, 2025
…ntel#18091)

RecordLayout::UnadjustedAlignment was documented as "Maximum of the
alignments of the record members in characters", but
RecordLayout::getUnadjustedAlignment(), which just returns
UnadjustedAlignment, was documented as getting "the record alignment in
characters, before alignment adjustement." These are not the same thing:
the former excludes alignment of base classes, the latter takes it into
account. ItaniumRecordLayoutBuilder::LayoutBase was setting it according
to the former, but the AAPCS calling convention handling, currently the
only user, relies on it being set according to the latter.

Fixes LLVM #135551.
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.

3 participants