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] use incomplete aggregate initializers #79062

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

AlexMaclean
Copy link
Member

The PTX ISA specifies that initializers may be incomplete (5.4.4. Initializers)

As in C, array initializers may be incomplete, i.e., the number of initializer elements may be less than the extent of the corresponding array dimension, with remaining array locations initialized to the default value for the specified array type.

Emitting initializers in this form is preferable because it reduces the size of the PTX, in some cases significantly, and can improve compile time of ptxas as a result.

@AlexMaclean
Copy link
Member Author

@Artem-B, could you please review this MR when you have a chance?

llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp Outdated Show resolved Hide resolved
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp Outdated Show resolved Hide resolved
llvm/test/CodeGen/NVPTX/globals_init.ll Show resolved Hide resolved
@AlexMaclean
Copy link
Member Author

@Artem-B, I've addressed all comments, please let me know if there is anything else I should do to fix this up, if not please land on my behalf once tests pass.

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.

LGTM with a comment nit.

@AlexMaclean
Copy link
Member Author

@Artem-B, could you please land this om my behalf?

@Artem-B Artem-B merged commit 3b8539c into llvm:main Jan 24, 2024
3 of 4 checks passed
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.

None yet

2 participants