Skip to content
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

[CIR][ABI][AArch64][Lowering] Support structures with padding #1118

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

bruteforceboy
Copy link
Contributor

The title describes the purpose of the PR. It adds initial support for structures with padding to the call convention lowering for AArch64.

I have also initial support for the missing feature FinishLayout for records, and the logic is gotten from the original codegen.

Finally, I added a test for verification.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Content LGTM, some minor nits before approval


// Finally, round the size of the record up to the alignment of the
// record itself.
uint64_t UnpaddedSize = getSizeInBits() - UnfilledBitsInLastUnit;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still missing a bunch of camelback here, if there are more elsewhere plz fix them too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have clang-tidy rules set up to try to catch casing violations. If you have any way of integrating clang-tidy into your editor (it usually comes along if you set up a clangd LSP, for example), it'll flag all the casing errors and can even auto-fix them, which is pretty convenient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are from the OG codegen and I wanted to use them as they were there, but I'll update.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's totally understandable. The context here is that during the upstreaming process for ClangIR, we had a long discussion about style, which was codified in https://llvm.github.io/clangir/GettingStarted/coding-guideline.html to prevent any further issues. I know it takes some work to adapt OG codegen code to our conventions, which is why I suggested clang-tidy to automate it if at all possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @smeenai. I will update the PR soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

S_PAD s;
return s;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+EOL

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.

4 participants