-
Notifications
You must be signed in to change notification settings - Fork 100
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
clang/lib/CIR/Dialect/Transforms/TargetLowering/RecordLayoutBuilder.cpp
Outdated
Show resolved
Hide resolved
clang/lib/CIR/Dialect/Transforms/TargetLowering/LowerFunction.cpp
Outdated
Show resolved
Hide resolved
|
||
// Finally, round the size of the record up to the alignment of the | ||
// record itself. | ||
uint64_t UnpaddedSize = getSizeInBits() - UnfilledBitsInLastUnit; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+EOL
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.