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

[NVPTX] fixup support for over-aligned parameters #92457

Merged
merged 2 commits into from
May 17, 2024

Conversation

AlexMaclean
Copy link
Member

This extends the NVPTX support for over-aligned parameters and return values in a few related ways:

  • Support for alignstack attribute, as an alternative to legacy nvvm !"align" metadata entries. While we still maintain the legacy support, long term it might be nice to auto-upgrade to alignstack.
  • Check the alignment info when emitting the parameter list to prevent a mismatch between alignment of caller and callee, which would previously cause a fatal error for ptxas.
  • Check the alignment info when emitting loads for parameters, potentially enabling better vectorization.

Copy link
Member

@Artem-B Artem-B left a comment

Choose a reason for hiding this comment

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

Nice! LGTM.

bool getAlign(const Function &F, unsigned index, unsigned &align) {
MaybeAlign getAlign(const Function &F, unsigned Index) {
// First check the alignstack metadata
if (MaybeAlign AlignStack =
Copy link
Member

Choose a reason for hiding this comment

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

Nit: In some places you're using StackAligh, in others AlignStack. It might be good to settle on one variant when we're dealing with the same info.

@AlexMaclean AlexMaclean merged commit 8da3a8f into llvm:main May 17, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants