Skip to content

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.

@AlexMaclean AlexMaclean requested a review from Artem-B May 16, 2024 21:10
@AlexMaclean AlexMaclean self-assigned this May 16, 2024
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
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.

2 participants